Vertical Order Traversal of a Binary Tree | O(n) method | Trees

Опубликовано: 28 Октябрь 2024
на канале: Fit Coder
3,086
83

In this video, I have discussed how to find vertical order traversal of a binary tree. I have discussed hashmap based optimized approach which has a time complexity of O(n)
The vertical order traversal of a binary tree is a list of top-to-bottom orderings for each column index starting from the leftmost column and ending on the rightmost column.
If two nodes are in the same row and column, the order should be from left to right.

Source code: https://github.com/fit-coder/fitcoder...

00:00 Introduction
00:05 What is Vertical Order Traversal?
00:51 Pseudo Code
10:22 Implementation

-------------------------------------------------------------
I live in New Delhi and love explaining programming concepts. I have done M.Tech(BITS Pilani) + B.Tech(PEC, Chandigarh) in Computer Science and am currently working as a software engineer in a MNC.
If you like my content, please like, share my videos and subscribe to the channel.
-------------------------------------------------------------

For other tree tutorials, please refer to the below links:
Introduction to Trees:    • Introduction to Trees | Trees Tutoria...  
Binary Trees:    • Introduction to Binary Trees | Trees ...  &t=8s
Binary Tree Traversals:    • Binary Tree Traversals | Inorder, Pre...  &t=64s
Shortcut trick for Binary Tree Traversals:    • Shortcut Trick for Binary Tree Traver...  
Inorder Traversal Iterative:    • Inorder Traversal of Binary Tree with...  
Preorder Traversal Iterative:    • Preorder Traversal of Binary Tree wit...  
Postorder Traversal Iterative (2 stack method):    • Postorder Traversal of Binary Tree Us...  
Postorder Traversal Iterative (1 stack method):    • Postorder Traversal of Binary Tree Us...  
Level Order Traversal:    • Level Order Traversal of Binary Tree ...  
Morris Inorder Traversal:    • Morris Inorder Traversal of Binary Tr...  
Zigzag Level Order Traversal:    • Zigzag (Spiral) Level Order Traversal...  
Binary Tree From Inorder and Preorder (Recursive):    • Construct Binary Tree From Inorder an...  
Binary Tree From Inorder and Preorder (Iterative):    • Construct Binary Tree From Inorder an...  
Binary Tree From Inorder and Postorder (Recursive):   • Construct Binary Tree From Inorder an...  
Binary Tree From Inorder and Postorder (Iterative):   • Construct Binary Tree From Inorder an...  
Binary Tree From Inorder and Levelorder:    • Construct Binary Tree From Inorder an...  
Binary Tree From Preorder and Postorder:    • Construct Full Binary Tree From Preor...  
Height of a Binary Tree (Recursive):    • Height (Maximum Depth) of a Binary Tr...  
Height of a Binary Tree (Iterative):    • Height (Maximum Depth) of a Binary Tr...  &t=385s
Diameter of a Binary Tree:    • Diameter of a Binary Tree | Trees  
Lowest Common Ancestor:    • Lowest Common Ancestor (LCA) in a Bin...  
Left View and Right View (Recursive):    • Left View and Right View of Binary Tr...  
Left View and Right View (Iterative):    • Left View and Right View of Binary Tr...  
Top View and Bottom View (Recursive):    • Top View and Bottom View of Binary tr...  
Top View and Bottom View (Iterative):    / =-cr4i8ztxgc  
Boundary Traversal:    • Boundary Traversal of Binary Tree | T...  

For in-depth Graph theory and implementation details, please refer to the below playlist:
   • Introduction to Graphs Data Structure  &list=PLFj4kIJmwGu3m30HfYDDufr3PZBfyngr0

#DataStructure,#Trees,#FitCoder,#Algorithm,#competitiveprogramming,#binarytree