Twitch Interview Question: Print a binary tree row-by-ro... |

Interview Question

Senior Software Engineer Interview Seattle, WA (US)

Print a binary tree row-by-row, printing left-to-right for

  even numbered rows and right-to-left for odd numbered rows.

Interview Answer

1 Answer


Implemented using Breadth-First-Search and keeping track of the current level, printing once you had 2^L items queued up.

Interview Candidate on 6 Jun 2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.