Given a binary tree. Print the nodes in vertical and zigzag manner. <strong?vertical traversal<=”” strong=””></strong?vertical> For example, we have binary tree below: 1 / \ 2 3 / \ / \ 4 5 6 7 vertical traversal will output: 4 2 1 5 6 3 7 We can clearly see that we are printing the […]
Tag Archives: traversal
From wiki, A binary search tree is a rooted binary tree, whose internal nodes each store a key (and optionally, an associated value) and each have two distinguished sub-trees, commonly denoted left and right. The tree additionally satisfies the binary search tree property, which states that the key in each node must be greater than all […]