I'm trying to come up with examples of recursive algorithms / functions that cannot be rewritten in a way that avoids using lots of stack memory (i.e. cannot be made fully tail recursive nor rewritten using a loop that doesn't use a stack). Do such functions exist?
I think quicksort might be a candidate, but am not sure if it can be rewritten to use a single tail-recursive function call.