4 ms·
I 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 d
by probinso 7y ago
I 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 7y 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 7y agoIt is. But why "invert" and not "mirror"?
- marsrover 7y agoI agree it's ambiguous wording.