← Amazon questions

Print endmost nodes in zig-zag fashion

Filed under Amazon

Given a binary tree, print the endmost nodes (leftmost or rightmost) in a zig-zag order level by level. At odd levels, print the leftmost node; at even levels, print the rightmost node (or vice…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.