In this video i have explain tree traversal preorder ,postorder and inorder in hindi.
#treetraversal #treetraversalinhindi #treetraversalpreorderpostorderinorderinhindi
In a binary tree, the preorder traversal visits the root node first, then recursively performs a preorder traversal of the left subtree, and finally recursively performs a preorder traversal of the right subtree.
In a binary tree, the inorder traversal visits the left subtree first by recursively performing an inorder traversal, then visits the root node, and finally recursively performs an inorder traversal of the right subtree.
In a binary tree, the postorder traversal visits the left subtree first by recursively performing a postorder traversal, then visits the right subtree recursively by postorder traversal, and finally visits the root node.
It is important to notice that preorder traversal gives you the root first, then the left subtree and after the right subtree. Inorder traversal gives you left subtree first, then the root and after the right subtree. And postorder gives left subtree first, then right subtree and after the root node.