home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / misc / math / permutation.lha / Permutation / permutation.readme < prev    next >
Encoding:
Text File  |  1999-08-27  |  872 b   |  35 lines

  1. Short:        Generate permutations, source code in C
  2. Uploader:     ralf.gruner@t-online.de (Ralf Gruner)
  3. Author:       ralf.gruner@t-online.de (Ralf Gruner)
  4. Type:         misc/math
  5. Distribution: Public Domain
  6.  
  7.  
  8.  This program generates all permutations of the elements of an array.
  9.  The example works with an array of characters, but can be changed for
  10.  any other element types.
  11.  
  12.  Use the executable in a shell window with this syntax:
  13.  
  14.  permutation <text>
  15.  
  16.  
  17.  Example:
  18.  
  19.  1.Ram Disk:>permutation abc
  20.  abc
  21.  acb
  22.  bac
  23.  bca
  24.  cab
  25.  cba
  26.  
  27.  
  28.  The code is a port of a Pascal program I have written in 1988.
  29.  The permutations are generated in a recursive function using a mask
  30.  for filtering the remainig elements.
  31.  The sort algorithm is simple and can be replaced by the library
  32.  function qsort or can be removed.
  33.  
  34.  Ralf Gruner, Großschönau, Germany                    27 August 1999
  35.