ShriyanshiSrivastava / Data_Structures_For_Hacktoberfest

A repository to get started with open source and contribute in Hacktoberfest . You can add any data structures and algorithms code in the language of your choice.
16 stars 80 forks source link

Add Zig Zag Traversal Binary Tree #173

Open fizznix opened 3 years ago

fizznix commented 3 years ago

Zig Zag Traversal: Given the root of a binary tree, returns the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between). Input: root = [3,9,20,null,null,15,7] Output: [ [3], [20,9], [15,7] ]