Click here to Skip to main content
15,901,426 members
Home / Discussions / C#
   

C#

 
GeneralRe: dll security Pin
amit_upadhyay3-Sep-09 6:17
amit_upadhyay3-Sep-09 6:17 
AnswerRe: dll security Pin
Arun Jacob3-Sep-09 18:06
Arun Jacob3-Sep-09 18:06 
GeneralRe: dll security Pin
amit_upadhyay3-Sep-09 22:54
amit_upadhyay3-Sep-09 22:54 
GeneralRe: dll security Pin
Arun Jacob3-Sep-09 22:56
Arun Jacob3-Sep-09 22:56 
GeneralRe: dll security Pin
mustang863-Sep-09 6:21
mustang863-Sep-09 6:21 
GeneralRe: dll security Pin
amit_upadhyay3-Sep-09 6:30
amit_upadhyay3-Sep-09 6:30 
GeneralRe: dll security Pin
mustang863-Sep-09 10:22
mustang863-Sep-09 10:22 
QuestionProblem with sorting string using radix sort [modified] Pin
gamer11272-Sep-09 20:16
gamer11272-Sep-09 20:16 
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 < arrayOfLastNames.Length; a++)
           {
               int W = arrayOfLastNames[a].Length;
               Console.WriteLine("{0}", W);

               string[] temp = new string[arrayOfLastNames.Length];
               for (int d = W - 1; d >= 0; d--)
               {
                   int[] count = new int[50];
                   for (int i = 0; i < N; i++)
                   {
                       count[arrayOfLastNames[i][d] + 1]++; //this is the part that causes the IndexOutOfRange exception
                   }
                   for (int k = 1; k < 256; k++)
                   {
                       count[k] += count[k - 1];
                   }
                   for (int i = 0; i < N; i++)
                   {
                       temp[count[arrayOfLastNames[i][d]]++] = arrayOfLastNames[i];
                   }
                   for (int i = 0; i < N; i++)
                   {
                       arrayOfLastNames[i] = temp[i];

                       Console.WriteLine("{0}", arrayOfLastNames[i]);
                   }
               }
           }


How will i prevent that from happening?

Can someone please help me? I really need to finish this before saturday because it's the passing date. I have exams tomorrow until this coming monday. If I solve this problem today I'll be able to finish it until tomorrow because i'll be doing one more procedure tomorrow and that's the binary search. So please help me.

modified on Thursday, September 3, 2009 5:33 AM

AnswerRe: Problem with sorting string using radix sort [modified] Pin
Calla3-Sep-09 4:53
Calla3-Sep-09 4:53 
GeneralRe: Problem with sorting string using radix sort Pin
gamer11273-Sep-09 5:15
gamer11273-Sep-09 5:15 
GeneralRe: Problem with sorting string using radix sort Pin
Calla3-Sep-09 20:45
Calla3-Sep-09 20:45 
QuestionSkinning a WinForm Pin
Azghar Hussain2-Sep-09 19:49
professionalAzghar Hussain2-Sep-09 19:49 
QuestionHow to geta an Event? Pin
Jacobb Michael2-Sep-09 19:13
Jacobb Michael2-Sep-09 19:13 
AnswerRe: How to geta an Event? Pin
Calla2-Sep-09 20:25
Calla2-Sep-09 20:25 
GeneralRe: How to geta an Event? Pin
Jacobb Michael2-Sep-09 23:24
Jacobb Michael2-Sep-09 23:24 
QuestionHow to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:00
dean93592-Sep-09 19:00 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Muhammad Mazhar2-Sep-09 19:08
Muhammad Mazhar2-Sep-09 19:08 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:55
dean93592-Sep-09 19:55 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Orzer2-Sep-09 21:34
Orzer2-Sep-09 21:34 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93593-Sep-09 8:20
dean93593-Sep-09 8:20 
QuestionChanging value of several comboboxes Pin
Denis J. González2-Sep-09 16:42
Denis J. González2-Sep-09 16:42 
AnswerRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:01
protectorChristian Graus2-Sep-09 17:01 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:06
Denis J. González2-Sep-09 17:06 
GeneralRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:13
protectorChristian Graus2-Sep-09 17:13 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:24
Denis J. González2-Sep-09 17:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.