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

> Being able to choose the appropriate data structure and explain trade-offs etc is much more valuable than simply knowing how to reverse a binary tree sorta stuff.

Indeed. The simplest way to invert a binary tree is to include an "invert" flag in the data structure. If it's set, walk the tree right to left instead of left to right.



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

Search: