On phone (so untested pseudo code), but this is my standard way of thinking about it. I think implementing bfs and dfs also helps to get it a bit more.
And I have needed to do recursion on web dev, because it’s the easiest way to deal with trees on your own.
If n == 0
Log(“std rec ex ” + n)n -= 1
Hip(n)
}
On phone (so untested pseudo code), but this is my standard way of thinking about it. I think implementing bfs and dfs also helps to get it a bit more.
And I have needed to do recursion on web dev, because it’s the easiest way to deal with trees on your own.