Tail recursion (87)

48 Name: #!/usr/bin/anonymous : 2006-03-10 14:05 ID:Heaven

I did read them, if not all that thoroughly, but I didn't see a general proof of this. For instance, how do I, with recursion, do:

  1. >>37,39,40?
  2. Take a list of the numbers 0..n, and shuffle them in random order in O(n) time and O(n) memory? (Preferrably without using any more memory than the list already uses, and without running through it more than one time.)
  3. Perform a Shell Sort? (http://en.wikipedia.org/wiki/Shell_sort)
  4. Perform a Pigeonhole Sort? (http://en.wikipedia.org/wiki/Pigeonhole_sort)

Maybe I am getting ahead of myself since these are mostly built around array indexing, but that's pretty much what iterative loops are all about anyway.

This thread has been closed. You cannot post in this thread any longer.