Trees - Trees Lecture 8 Discrete Mathematical Structures...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Trees Lecture 8 Discrete Mathematical Structures
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Rooted Tree Let A be a set, and let T be a relation on A . T is a rooted tree if there is a vertex v 0 in A with the property that there exists a unique path in T from v 0 to every other vertex in A , but no path from v 0 to v 0 . v 0
Background image of page 2
Properties of Rooted Tree Let ( T , v 0 ) be a rooted tree. Then (a) There are no cycles in T . (b) v 0 is the only root of T . (c) Each vertex other than the root has in-degree one, and the root has in-degree 0 v 0 v p c More than one path from v 0 to v . (a) v 0 v 0 A cycle from v 0 to v 0 (b) v 0 v k w 1 ? More path to w 1 ? (c)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Drawing a Rooted Tree by Levels Root Inner node Branching node Leaf Level 0 Level 1 Level 2 Level 3 Height=3
Background image of page 4
Rooted Tree and Family Relations It is easy to describe the family relations T and on the other hand, terms about family relations are used in rooted trees. John John's child John's parent John's ancestors John's descendants John’s siblings
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Some Terms about Rooted Tree Ordered tree: the ordering is assumed on vertices in each level; n -tree: every vertex has at most n offspring; Complete n -tree: every vertes, other than leaves, has exactly n offspring Binary tree: 2-tree
Background image of page 6
Subtree of a Rooted Tree If ( T , v 0 ) is a rooted tree and v T . Let T ( v ) be the set of v and all its descendants, then T ( v ) and all edges with their two ends in T ( v ) is a tree, with v as its root. (It is called a subtree of ( T , v 0 ) ) Proof: There is a path from v to any other vertex in T ( v ) since they are all the descendants of v; There cannot be more than one path from v to any other vertex w in T ( v ) , otherwise, in ( T , v 0 ), there are more than one path from v 0 to w, both through v There cannot be any cycle in T ( v ), since any cycle in T ( v ) is also in ( T , v 0 )
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
In a ordered binary tree, a subtree is a left subtree or a right subtree. Even if a vertex has only one offspring, its subtree can be identified as left or right by its location in the digraph. Left
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 33

Trees - Trees Lecture 8 Discrete Mathematical Structures...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online