Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hip(n) {

If n == 0

  Return
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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: