4 ms·
It means to reverse it left-to-right, like a mirror. You will never have to implement this yourself for real.
by gaius 8y ago
It means to reverse it left-to-right, like a mirror.
You will never have to implement this yourself for real.
- monocasa 8y agoYou won't because it's a toy problem, not because it something only greybeards did in libraries written decades ago. Asking someone to describe the simplest possible transformations on one of the simplest data structures isn't a stretch, and this is coming from someone without a CS degree. EDIT: And that's not to say Google doesn't have a screwed up hiring system. I know someone who implemented a dynamic programming problem correctly, with the appropriate big O complexity, but was rejected because the constant time factor was slightly higher than what the interviewer was looking for. That's a BS decision; Max Howell's was not.
- hinkley 8y agoThere's another term for reversing a tree: reversing a tree. 'Reverse' is switching the orientation left to right or front to back. Top to bottom is 'inverting' (except in graph theory where inverting means something entirely... weird). > other than the interviewer was too proud to admit they made a mistake.