← Goldman Sachs questions

Print nodes in a zig-zag form of a given binary tree

Filed under Goldman Sachs

Traverse and print the nodes of a given binary tree in a zig-zag (spiral) order, alternating between left-to-right and right-to-left for each successive level.

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 Goldman Sachs questions

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