27 February 2026
28 February 2026
Awoninyam Kojo StephenWhen do we use recursion?
On what circumstance should recursion come into your head?
Recursion is used when you have a problem that can be solved in steps...
Each recursion level should deal with a single step, until you are left with just one more calculation (called base case - stopping case)
Awoninyam Kojo StephenSo in what case should a recursion stops when traversing through a tree?
When it found what it was looking for.
Awoninyam Kojo StephenSo let's consider a BST
I wanted to add a value to the the tree at any level using a recursion
I don't know the base case I should use
When you found the space to insert you were looking for.
Replymessage unavailable
I hardly suggest you to not use videos.
Videos make you follow steps you may not understand, and once you get stuck, they proceed without you understanding. So you have to spend double of the time looking up for a solution online etc while books are more explainatory and guide you, making you understand each single word.