Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 36 Section 12.2 Mon, Apr 23, 2007

Similar presentations


Presentation on theme: "Lecture 36 Section 12.2 Mon, Apr 23, 2007"— Presentation transcript:

1 Lecture 36 Section 12.2 Mon, Apr 23, 2007
Binary Trees Lecture 36 Section 12.2 Mon, Apr 23, 2007 2/17/2019 Binary Trees

2 Binary Trees A binary tree is a data structure with the following properties. It is either empty or it has a root node. Each node in the binary tree may have up to two children (called left and right). Each node, except the root node, has exactly one parent. The root node has no parent. 2/17/2019 Binary Trees

3 A Binary Tree 10 20 30 40 50 60 70 2/17/2019 Binary Trees

4 Terminology The tree metaphor The family metaphor
tree, root, branch, leaf. The family metaphor parent, child, sibling, ancestor, descendant. 2/17/2019 Binary Trees

5 Tree Terminology 10 20 30 40 50 60 70 2/17/2019 Binary Trees

6 Tree Terminology Root 10 20 30 40 50 60 70 2/17/2019 Binary Trees

7 Tree Terminology 10 20 30 40 50 60 70 Parent 2/17/2019 Binary Trees

8 Tree Terminology 10 20 30 40 50 60 70 Leaves 2/17/2019 Binary Trees

9 Tree Terminology 10 20 30 40 50 60 70 Right Child 2/17/2019
Binary Trees

10 Tree Terminology Subtree 10 20 30 40 50 60 70 2/17/2019 Binary Trees


Download ppt "Lecture 36 Section 12.2 Mon, Apr 23, 2007"

Similar presentations


Ads by Google