Amazon Interview Question

zig-zag traversal of a tree