In this video, I have discussed Preorder traversal without recursion. For the iterative preorder traversal, a stack is used.
In preorder traversal, root is visited first, then the left subtree and later the right subtree.
Source code: https://github.com/fit-coder/fitcoder...
00:00 Introduction
00:04 Preorder traversal (Recap)
00:38 Preorder traversal Pseudo code
05:26 C++ 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