Skip to main content

Tree Algorithms

Learn Tree Algorithms (Algorithms, Programming Fundamentals) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

A tree is a hierarchical data structure made of nodes, where each node has a value and links to child nodes. A Binary Tree restricts each node to at most two children - "left" and "right". Traversal means visiting every node exactly once in some defined order. The three classic Depth-First traversal orders for binary trees are: • Inorder (Left, Root, Right) • Preorder (Root, Left, Right) • Postorder (Left, Right, Root)

More lessons in Algorithms