Amazon interview question

Question from one developer: Write code to traverse the binary in "level order" in any languages - C, C++ or Java. Describe Time and Space complexities

Interview Answer

Anonymous

Aug 18, 2015

As you visit each node, you keep both next and right pointers in a queue (FIFO). Time Complexity O(n)