Skip to Main Content
Data Structures Using C, 2nd Edition by Pearson
book

Data Structures Using C, 2nd Edition by Pearson

by A. K. Sharma
May 2024
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 12m
English
Pearson India
Content preview from Data Structures Using C, 2nd Edition by Pearson
354 Data Structures Using C
This can be formally defined as:
LLi
INT
i1
N
=
=
Where L
i
: is the path length of internal node i
From induction , we can say that : L
EXT
= L
INT
+ 2 * N, where N is number of internal nodes.
In EBT of Figure 7.49, N = 6, therefore, L
EXT
= L
INT
+ 2 * N = 8 + 2 * 6 = 20.
Weighted Binary Tree: So far we have considered the cost of an edge between two nodes as one unit. In
real world the edges may differ in terms of length, weight, degree of comfort, profit, utility etc. However,
in order to keep things simpler, let us
keep the cost between each edge as one
but assign a weight W
i
to an ith external
node as shown in Figur
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey
Intermediate C Programming, 2nd Edition

Intermediate C Programming, 2nd Edition

Yung-Hsiang Lu, George K. Thiruvathukal

Publisher Resources

ISBN: 9781299831582