home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_05 / 1105034a < prev    next >
Text File  |  1993-03-03  |  288b  |  16 lines

  1. // Copyright (C) 1992 by Nicholas Wilt.  All rights reserved.
  2.  
  3. template<class T>
  4. void
  5. InsertionSort(T *base, int n)
  6. {
  7.     for (int i = 1; i < n; i++) {
  8.     T temp = base[i];
  9.     for (int j = i; j && temp < base[j - 1]; j--)
  10.         base[j] = base[j - 1];
  11.     base[j] = temp;
  12.     }
  13. }
  14.  
  15.  
  16.