
Tree Traversal:
Tree traversal is a method of visit all the nodes of the tree and also displays their data. All the nodes are connecting via link which means edge. So the edge is used to visit all the nodes in the tree. Tree traversal is classified into three orders. They are:
- Inorder traversal
- Preorder traversal
- Postorder traversal
Inorder traversal - In this method, the left subtree is visited first after that the root node and finally right subtree. In tree traversal every node may represent a subtree itself.
Preorder traversal - In this method, the root is visited first after that the left subtree node and finally right subtree node.
Postorder traversal - In this method, the left subtree node is visited first after that the right subtree node and finally root node is visited.

Want to see the full answer?
Check out a sample textbook solution
Chapter 25 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningOperations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole





