Click here to Skip to main content
16,011,905 members
Home / Discussions / C#
   

C#

 
AnswerRe: Link List Pin
leppie22-Jun-08 21:16
leppie22-Jun-08 21:16 
GeneralRe: Link List Pin
benjamin yap23-Jun-08 0:30
benjamin yap23-Jun-08 0:30 
GeneralRe: Link List Pin
User 665823-Jun-08 0:43
User 665823-Jun-08 0:43 
GeneralRe: Link List Pin
Anthony Mushrow23-Jun-08 1:07
professionalAnthony Mushrow23-Jun-08 1:07 
GeneralRe: Link List Pin
leppie23-Jun-08 11:18
leppie23-Jun-08 11:18 
GeneralRe: Link List [modified] Pin
benjamin yap23-Jun-08 17:09
benjamin yap23-Jun-08 17:09 
GeneralRe: Link List Pin
leppie23-Jun-08 21:23
leppie23-Jun-08 21:23 
GeneralRe: Link List Pin
benjamin yap24-Jun-08 2:09
benjamin yap24-Jun-08 2:09 
I realli cannot figure out. i tried this any keep getting error

Original Sample
  public static void qsort(char[] items) { 
    qs(items, 0, items.Length-1); 
  } 
 
  // A recursive version of Quicksort for characters. 
  static void qs(char[] items, int left, int right)  
  {  
    int i, j;  
    char x, y;  
  
    i = left; j = right;  
    x = items[(left+right)/2];  
  
    do {  
      while((items[i] < x) && (i < right)) i++;  
      while((x < items[j]) && (j > left)) j--;  
  
      if(i <= j) {  
        y = items[i];  
        items[i] = items[j];  
        items[j] = y;  
        i++; j--;  
      }  
    } while(i <= j);  
  
    if(left < j) qs(items, left, j);  
    if(i < right) qs(items, i, right);  
  } 
} 


My code

public void qsort(LinkList list)
        {
            qs(list, 0, list.size - 1);
        }

        public void qs(LinkList list, int left, int right)
        {
            int i, j;
            LinkList
  
            i = left; j = right;
            x = list[(left+right)/2];

            do
            {
              while((list[i] < x) && (i < right)) i++;  
              while((x < list[j]) && (j > left)) j--;  
          
              if(i <= j) 
              {  
                y = list[i];  
                list[i] = list[j];  
                list[j] = y;  
                i++; j--;  
              }  
            } while(i <= j);  
  
            if(left < j) qs(list, left, j);  
            if(i < right) qs(list, i, right);  
  } 


I realli dont know what to change...because their example is using a char array. but for my case, i am using an object Entity which have 3 attributes
QuestionWhich to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 17:06
benjamin yap22-Jun-08 17:06 
AnswerRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 17:48
protectorChristian Graus22-Jun-08 17:48 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 17:57
benjamin yap22-Jun-08 17:57 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 17:59
protectorChristian Graus22-Jun-08 17:59 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 19:40
benjamin yap22-Jun-08 19:40 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 19:44
protectorChristian Graus22-Jun-08 19:44 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 19:49
benjamin yap22-Jun-08 19:49 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 19:57
protectorChristian Graus22-Jun-08 19:57 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
Christian Graus22-Jun-08 22:56
protectorChristian Graus22-Jun-08 22:56 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
darkelv22-Jun-08 19:50
darkelv22-Jun-08 19:50 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
benjamin yap22-Jun-08 19:53
benjamin yap22-Jun-08 19:53 
GeneralRe: Which to use? Database(sql,access) , XML, flat file Pin
darkelv23-Jun-08 4:15
darkelv23-Jun-08 4:15 
QuestionChange an XML attribute using C# Pin
nyjcr22-Jun-08 16:57
nyjcr22-Jun-08 16:57 
AnswerRe: Change an XML attribute using C# Pin
Christian Graus22-Jun-08 17:57
protectorChristian Graus22-Jun-08 17:57 
GeneralRe: Change an XML attribute using C# Pin
nyjcr23-Jun-08 7:56
nyjcr23-Jun-08 7:56 
Questionc# Pin
ManojKumarShah201722-Jun-08 16:49
ManojKumarShah201722-Jun-08 16:49 
AnswerRe: c# Pin
Bert delaVega22-Jun-08 17:37
Bert delaVega22-Jun-08 17:37 

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.