C# Programming
09-03-2009, 02:16 PM
Hello. I'm having a problem with the codes i used for sorting strings using radix sort..I always get the IndexOutOfRange exception.
Here is the code:
int N = arrayOfLastNames.Length;
for (int a = 0; a </span arrayOfLastNames.Length; a++)br / {br / span class="code-keyword"int/span W = arrayOfLastNames[a].Length;br / Console.WriteLine(span class="code-string""/spanspan class="code-string"{0}"/span, W);br /br / span class="code-SDKkeyword"string/span[] temp = span class="code-keyword"new/span span class="code-SDKkeyword"string/span[arrayOfLastNames.Length];br / span class="code-keyword"for/span (span class="code-keyword"int/span d = W - span class="code-digit"1/span; d span class="code-keyword">= 0; d--)
{
int[] count = new int[50];
for (int i = 0; i <span class="code-keyword">
Here is the code:
int N = arrayOfLastNames.Length;
for (int a = 0; a </span arrayOfLastNames.Length; a++)br / {br / span class="code-keyword"int/span W = arrayOfLastNames[a].Length;br / Console.WriteLine(span class="code-string""/spanspan class="code-string"{0}"/span, W);br /br / span class="code-SDKkeyword"string/span[] temp = span class="code-keyword"new/span span class="code-SDKkeyword"string/span[arrayOfLastNames.Length];br / span class="code-keyword"for/span (span class="code-keyword"int/span d = W - span class="code-digit"1/span; d span class="code-keyword">= 0; d--)
{
int[] count = new int[50];
for (int i = 0; i <span class="code-keyword">