Autor Beitrag
duffbartman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Di 13.12.05 18:58 
Hallo Leute, ich habe hier einen InsertionSort, leider verstehe ich ihn nicht ganz!! könnte mir vielleicht jemand anhand von kommentaren den genauen ablauf erklären?? ich wäre euch sehr dankbar!!!

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
public void InsertionSort(int iAnzahl)
    {
      int i1; 
      string tmpStr;
      for (int i2 = 1; i2 < iAnzahl; i2++)
      {
        i1= i2-1;
        tmpStr = SortListe[i2];
        while ((i1 >= 0) && String.Compare(tmpStr,SortListe[i1])<0)
        {
          SortListe[i1+1] = SortListe[i1];
          i1--;
        }
        SortListe[i1+1] = tmpStr;
      }
    }



Moderiert von user profile iconChristian S.: Topic aus C# - Die Sprache verschoben am Mi 14.12.2005 um 10:54