4 ms·
Reversing a binary search tree is a binary (pun intended) answer: you either know how to do it because you learned it in college/read Cracking the Coding Interv
by minimaxir 11y ago
Reversing a binary search tree is a binary (pun intended) answer: you either know how to do it because you learned it in college/read Cracking the Coding Interview, or you don't.
- smt88 11y agoThey also teach things like this in boot camps now. The graduates are trained to game these tests because placement rates are so important to boot camps. Assuming someone is a good programmer because of trivial examples like reversing a binary tree or, worse, writing a bubble sort is like asking someone you to use a wrench to prove that you're an architect.
- nostrademons 11y agoIs it not obvious that you reverse the left and right subtrees and then swap them? I learned how to think recursively in college. I never learned how to reverse a binary tree.
- sklogic 11y agoWhat? You do not need to know anything at all. The very wording of this problem is already a solution. No thinking required. No prior knowledge required.