4 ms·
Well, since nobody actually knows what "invert a binary tree" means, you've got a reasonable excuse...
by commandlinefan 8y ago
Well, since nobody actually knows what "invert a binary tree" means, you've got a reasonable excuse...
- probinso 8y agoI always assumed this meant Allocate an array sized by the number of leaves. Store all leaves. Reverse all pointers. Former head points to null. It's a dumb data structure
- marsrover 8y agoI believe it's more along the lines of just traversing a tree and setting left nodes to the right nodes and vice versa.
- throwaway55554 8y agoIt is. But why "invert" and not "mirror"?
- marsrover 8y agoI agree it's ambiguous wording.