Re:The greatest resume I've ever seen
by recursive on Thursday September 30, 2021 @11:59AM
(#28707856)
Wait, inverting a tree is a real thing? What does that even mean? All the terminal leaf nodes become roots? That can't be right. I thought part of the joke was that it was impossible.
[ Parent
| on HN ]
Horizontal inversion (mirror). I was equally confused though the first time I was asked lol.
Re:The greatest resume I've ever seen
by recursive on Thursday September 30, 2021 @12:09PM
(#28707973)
I would have called it "reversing", but I guess that sounds less technical. Now I'm confused, just in a different way. There's no obscure algorithm for this, just maybe 4 straight-forward lines, depending on language. I guess it tests whether you've ever heard of recursion.
I thought the meme depended on it being some obscure, difficult, and irrelevant thing.
Re:The greatest resume I've ever seen
by moron4hire on Thursday September 30, 2021 @12:25PM
(#28708155)
Well, now you know. It's a meme that has become its own meta-meme.
The root is still the root, but everything else is just flipped: https://leetcode.com/problems/invert-binary-tree/
It is also extremely simple:
TreeNode* invertTree(TreeNode* root) {
if (root) {
invertTree(root->left);
invertTree(root->right);
std::swap(root->left, root->right);
}
return root;
}