//
//  Order the symbol table
//

//  Use global array A to hold ordered strings.
i = 0;

order = function ( S )
{
  local(hm, lh, rh);

  if (S.n >= 3)
  {
    hm = int (S.n/2);
    lh = S[1:hm-1];
    rh = S[hm+1:S.n];

    i = i+1;
    A[i] = S[hm];

    # Now call ourselves

    order (lh);
    order (rh);
  else
    if (S.n >= 1)
    {
      i++;
      A[i] = S[1];
    }
    if (S.n == 2)
    {
      i++;
      A[i] = S[2];
    }
    return 1;
  }
};
