|
|
|
|
|
by yodelshady
695 days ago
|
|
Oh no, that bit's easy. But you don't ask them "swap the left and right field in each node". You ask them to "invert a binary tree". Why. The Fuck. Does "invert a binary tree" mean "swapping the left and right fields"? To me, it means inverting the relationship so child points to parent, which would end up badly-defined, there would be no way to uniquely specify a root. But if you don't know that knowledge, of what the jargon means, you're screwed. So that's what you're testing for. |
|
In real life they would either give you an example so you can better understand the requirements or expect you to come up with an example yourself and ask clarifying questions until you're on the same page as to what "invert" means.