can anyone clearly explain me the concept of inorder ,preorder,postorder traversal of tree
Hoot! You just asked your first question! Hang tight while I find people to answer it for you. You can thank people who give you good answers by clicking the 'Good Answer' button on the right!
i would suggest u that............. for inorder traversal LNR for preorder travesral NLR and for post order traversal LRN WHRE L=LEFT R=RIGHT AND N=ROOT NODE
The answer given by alex is slightly wrong and I hope everyone can get what gauravbasti2006 has written, That is the correct answer for the question
Basically, The order of traversal is related to the position of the root. If it is an INorder traversal, the root lies between Left and right nodes. In case of PREorder traversal, ROOT is before left and right nodes. For POSTorder, ROOT is after Left and Right nodes. The overall traversal is done recursively.
Join our real-time social learning platform and learn together with your friends!