Answer to Question 33B-1

void sort(List& L)
{
  List R = emptyList;
  for(List p = L; !isEmpty(p); p = tail(p))
  {
    insert(head(p), R);
  }
  destroy(L);
  L = R;
}