C Program to Print Spiral Order Traversal of a Binary Tree

By | May 9, 2017

Print Spiral Order Traversal


Write a C Program to Print Spiral Order Traversal of a Binary Tree. Here’s simple¬†Program to Print Spiral Order Traversal of a Binary Tree in C Programming Language.


Spiral Order Traversal


In spiral order traversal we need use two stacks. First stack is used to traverse the nodes at even level and second stack is used to traverse the nodes at odd level. Nodes at even level are stored in stack1 and are pushed in it from left to right order whereas nodes at odd level are stored in stack2 and are pushed in it from right to left order.

Also Read : : C Program for Level Order Traversal of binary tree using queue


Below is the source code for C Program to Print Spiral Order Traversal of a Binary Tree which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post…

One thought on “C Program to Print Spiral Order Traversal of a Binary Tree

  1. Pingback: Write a C Program for Creation of Adjacency Matrix

Leave a Reply