We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Create a list or an array to store traversal ie as you go left, until you encounter any leaf, then move back up and store those values. When you encounter a previous node with a right subtree, repeat the steps.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Postorder Traversal
You are viewing a single comment's thread. Return to all comments →
Create a list or an array to store traversal ie as you go left, until you encounter any leaf, then move back up and store those values. When you encounter a previous node with a right subtree, repeat the steps.