1
vote
Generic musings
The Programming Works
– Delphi (as Pascal descendant) has always had powerful type system. Consider the following sample code implementing simple insertion sort algorithm (I use Delphi 2009): unit InsSort; interface type TItem = Integer; TArray = array of TItem; procedure InsertionSort(var A: TArray); implementation procedure InsertionSort(var A: TArray); var I, J: Integer; Item: TItem; begin for I:= 1 + Low(A) to High(A) do begin Item:= A[I]; J:= I - 1; while (J >= Low(A)) and (A[J] > Item) do begin A[J + 1]:= A[J]; Dec(J); end; A[J + 1]:= Item; end; end; The ...
Statistics
|
Visits by Source |
User Actions |




