News for hackers. Stuff that matters.
Re:Invert a binary tree on LeetCode by de_Selby on Saturday June 13, 2015 @06:27AM (#9710552)
The problem wasn't to just reverse the nodes, it was to re-sort it:

> @rogerdai16 to min-max the tree, ascending to descending.

https://twitter.com/mxcl/status/608891015945170944

Re:Invert a binary tree on LeetCode by SamReidHughes on Saturday June 13, 2015 @06:52AM (#9710605)
I can't stand this. That's an equally intelligible description of the problem as the original.
Re:Invert a binary tree on LeetCode by de_Selby on Saturday June 13, 2015 @07:02AM (#9710638)
Well it's a 140 character description from someone who's probably feeling a bit emotional. I'm sure he got a clearer problem description in the actual interview.
Re:Invert a binary tree on LeetCode by falcolas on Saturday June 13, 2015 @08:59AM (#9710861)
I have to admit, the idea of swapping children on all of the nodes would not have come to me immediately as a solution for reversing the sorted tree - I have not been exposed to that kind of application before, and haven't spent a lot of time thinking about that kind of problem.

One more for the toolbox, I guess.

Re:Invert a binary tree on LeetCode by blahblah3 on Saturday June 13, 2015 @09:36AM (#9710954)
It sounds like the problem may have been to convert a min heap to a max heap?