







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Prof. Balamohan Pawar delivered this lecture at Allahabad University for Aeronautical Engineering and Computer Programming course. Its main points are: Theorem, Lemma, Colorrary, Claim, Proposition, Rooted, Graph, Tree, Vertex, Internal, Property, Binary
Typology: Slides
1 / 13
This page cannot be seen from the preview
Don't miss anything!








Binary Search Tree
5
Theorem : An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices.
6
a) b)
c) d)
9
10
11
c
a
b
d e f g
k l
m
h i j
Level of vertex f = Height of tree =
Level of vertex f = Height of tree =
2 4
12
15
Children of b? Parent of b? Ancestors of g? Descendants of b?
Leafs? Internal vertices? Left child of g? Right child of g?
c
a
b
d e f g
k l
m
h i j
d, e a c, a
FAREWELL TO AMY ADAMS The party atmosphere of Motown and theterrific backing rhythms of the Funk Brothers just couldn't bring out the best in Amy, whowas sent home this week.
d, e, h, i
h, i, e, j, k, m a, b, c, d, f, g k l
17
18
Let T be an ordered binary tree with root R
If T has only R then R is the preorder traversal Else Let T 1 , T 2 be the left and right subtrees at R Visit R Traverse T 1 in preorder Traverse T 2 in preorder
21
Let T be an ordered binary tree with root R
If T has only R then R is the postorder traversal Else Let T 1 , T 2 be the left and right subtrees at R Traverse T 1 in postorder Traverse T 2 in postorder Visit R
22
A special kind of binary tree in which:
23
ROOT
INORDER TRAVERSAL: 8 - 5 has value 3 PREORDER TRAVERSAL: - 8 5 POSTORDER TRAVERSAL: 8 5 -
24
What value does it have?What value does it have?
( 4 + 2 ) * 3 = 18
27
**Infix: ( ( 8 - 5 ) * ( ( 4 + 2 ) / 3 ) ) Prefix: * - 8 5 / + 4 2 3 Postfix: 8 5 - 4 2 + 3 / ***
Perfectly balanced tree Height balanced tree
Root
Leaf
Inner Vertex
Parent of B and C
Child of A
B and C are siblings
M-ary tree