Are some algorithms inherently recursive? As in, rewriting it in tail-recursive/iterative form with a stack is still needed, and there is no way to do it otherwise.
I am asking because I struggled to implement the function stringsMatchingPrefix on a Trie tail-recursively without a stack. The stringsMatchingPrefix problem is: given a string P, find all the words in the trie with the prefix P.