4 ms·
I’m not going to apologize for being harsh. But I will link a resource to help you understand. http://cslibrary.stanford.edu/110/BinaryTrees.html http://cslibra
by CodeWriter23 2y ago
I’m not going to apologize for being harsh. But I will link a resource to help you understand. http://cslibrary.stanford.edu/110/BinaryTrees.html http://cslibrary.stanford.edu/110/BinaryTrees.html
- kragen 2y agoThis page does not identify an algorithm that can be implemented in fixed space but is hard or impossible to do with tail recursion. No such algorithm exists. It is unclear which of the dozens of beautiful algorithms it presents you mistakenly believed to be one. tmtvl's comment at https://news.ycombinator.com/item?id=41983916 https://news.ycombinator.com/item?id=41983916 shows an algorithm that requires unbounded space. Traversing a mutable binary tree can be done in fixed space but is not easier to do with generalized forms of recursion than with tail recursion or imperative iteration.
- saagarjha 2y agoYou should, because not only are you being rude you are also wrong.
- CodeWriter23 2y agoBy saying code is used to access a binary tree? lol
- saagarjha 2y agoFor saying that you cannot write algorithms to deal with binary trees using tail recursion. Saying code is used to access a binary tree is a trivial statement with no value to it. Nobody is going to even bother responding to that because of how obvious it is.