Docsity

Tree Traversals: Definition, Rooted Trees, Algorithms, and Binary Search Trees, Slides of Data Structures and Algorithms

Partial preview of the text

Download Tree Traversals: Definition, Rooted Trees, Algorithms, and Binary Search Trees and more Slides Data Structures and Algorithms in PDF only on Docsity!

Trees and Tree Traversals

Outline

  • Graph-Tree
    • Basic Definition
    • Rooted Trees
    • Applications of Trees
    • Game Tree

Order Rooted Tree

• Is a rooted tree where the children of each

internal vertex are ordered.

  • ordered binary tree: two child, left/right

Tree Traversal

• Is a procedure that systematically visits

every vertex of an ordered rooted tree

  • Three most commonly used algorithms
    • Preorder traversal.
    • Inorder traversal.
    • Postorder traversal.

Example#

  • List three kinds of traversals.