You said that if we call a recursive method two times, we should have two stop conditions. But it is not always necessary, e.g. for dfs on a tree, we just have a single stop condition if(node == null) return smth. Although we call the dfs method recursively on the left and right sub-tree. Right?
@Mohamed-uf5jh2 жыл бұрын
Your course are the good quality, and the content is very helpful and clear so , I'am surpise you dont have mutch viewer in the video I'am sorry :(
@geekific2 жыл бұрын
I appreciate that! Thanks for your support man :)
@fishamus13062 жыл бұрын
good video. Really good visuals as well.
@geekific2 жыл бұрын
Thanks! Glad you think so :)
@vengateshm21223 жыл бұрын
Hey geefic! That's a cool stuff. Please explain tail recursion and also the tree traversal using recursion.
@geekific3 жыл бұрын
Hey thank you! Glad you liked it! You can check the traversal implementation in here: kzbin.info/www/bejne/sHq7ZK2HhZWenq8 and I'll make sure to cover in a future video the logic behind the tree recursive methods we implemented in detail. I will also explain tail recursion, but until then simply know that a recursive method is considered tail recursive when a recursive call is the last thing executed by that method. The factorial example we had for instance is non-tail-recursive, as the last thing done by this method is the multiplication and not the recursion. Cheers :)
@williammcenaney1331 Жыл бұрын
This excellent video told me why the recursive factorial function confused me. I would have understood that function if I calculated each factoial separately when I wanted to know what 5! equaled. I tried to memorize the function without thinking about what it meant. I acted like a Christian who believes you understand a Bible verse only if you memorized it. By the way, recursive functions call copies of themselves.