Challenge: Print Spiral Tree

Let’s print a binary tree in spiral order.

Problem

Given a binary tree, print the nodes breadth-first in spiral order.

Input

A binary tree.

Output

Display a breadth-first spiral order traversal of the tree on the console.

Sample input

Get hands-on with 1400+ tech skills courses.