994_______________________________________________ 15


 TList:

void _fastcail Exchange(int Indexl, int Index2);

 TStrings  TStringList:

virtual void   fastcail Exchange(int Indexl, int Index2);



  Exchange      Indexl  Index2 -
 .      (   ).

       ,   
       .

   Exchange    TStringList. 
      , 
  .   ,   Exchange    -
     .



  List  TList     .  -
         
 (    ).

for(int i = 1; i < List->Count; i++)

if(*((int *)List->Items[0]) > *( (int *)List->Items[i]))
List-exchange (0, i) ;

        -
  :

for(int j = 0; j < List->Count-l; j++)
for(int i = j; i < List->Count; i++)

if (*((int *)List->Items[j]) > *((int *)List->Items[i]))
List-exchange (j , i) ;

Expand

    TList
 TList



TList* _fastcail Expand(void);



 Expand     TList.   
   .      -
     .

    ,     -
     .

   , ..   Count  
 Capacity,    .   Count == Capacity,  
Expand   Capacity   .  -
 Capacity  4,  Capacity   4.   Capacity
 4,   9,  Capacity   8.   Capacity -
 8,  Capacity   16.