Professional Documents
Culture Documents
Trees Part 1
Trees Part 1
Part I
Lecture 10
Lecture Objectives
⚫ Tree
⚫ Binary Tree
Introduction Why Trees ?
Before Tree we were using
Tree : Definition
A Tree consists of a finite set of element, called nodes and a finite set of directed
lines called branches, that connect the nodes
Indegree:
Basic Concepts When a branch is directed toward the node
Degree:
estor :
ny node in the path from
to the node
Indegree:
Basic Concepts When a branch is directed toward the node
Degree: Guess
Ancestor :
Is any node in the path
from root to the node
Descendant :
all nodes in the path from
that node to leaf
Data node
Structure & Algorithms ‹#›
Basic Concepts A Tree may be divided into SUBTREEs
SubTree
What is a Sub Tree ?
How ? empty
or
A Tree is a set of nodes that are
Has a node
called root
Parenthetical List
A ( B (C D) E F (G H I ))