Is it a convention that while traversing in a binary tree we move to left and then to right?? Why can't we move from right to left?
Is it a convention that while traversing in a binary tree we move to left and then to right?? Why can't we move from right to left?
As Binary Tree has a default behaviour of Sorted Order i.e: Small Number than root node to left and Larger Number to Right. So Due to above-mentioned behaviour traversals conventions are left to right with an assumption that above tree is in sorted order. Whereas it's just a convention, if you want to traverse right to left then you can place Larger Number than Root Node to Left Side and Smaller Number to Right Side of Binary-Tree.