SlideShare a Scribd company logo
Optimal Binary Search Tree
Dr. P. Subathra
Prof/ IT
KAMARAJ College of Engg. & Tech
(AUTONOMOUS)
Madurai
Tamil Nadu
India
• If probabilities of searching for elements of a set are
known—e.g., from accumulated data about past
searches—it is natural to pose a question about an
optimal binary search tree for which the average
number of comparisons in a search is the smallest
possible.
• we limit our discussion to minimizing the average
number of comparisons in a successful search.
• The method can be extended to include unsuccessful
searches as well.
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
2
• The total number of binary search trees with n
keys is equal to the nth Catalan number
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
3
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
4
OBST CREATION
(j-i)=0
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0
1
2
3
4
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
5
OBST CREATION
No. of Nodes = 0
(j-i)=0
(0-0) = 0 = C[0,0]
(1-1) = 0 = C[1,1]
(2-2) = 0 = C[2,2]
(3-3) = 0 = C[3,3]
(4-4) = 0 = C[4,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0
1 0
2 0
3 0
4 0
6
OBST CREATION
No. of Nodes = 1
(j-i)=1
(1-0) = 1 = C[0,1]
(2-1) = 1 = C[1,2]
(3-2) = 1 = C[2,3]
(4-3) = 1 = C[3,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0
1 0
2 0
3 0
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
7
OBST CREATION
No. of Nodes = 1
(j-i)=1
(1-0) = 1 = C[0,1] = 41
(2-1) = 1 = C[1,2]
(3-2) = 1 = C[2,3]
(4-3) = 1 = C[3,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0 41
1 0
2 0
3 0
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
8
OBST CREATION
No. of Nodes = 1
(j-i)=1
(1-0) = 1 = C[0,1] = 41
(2-1) = 1 = C[1,2] = 22
(3-2) = 1 = C[2,3]
(4-3) = 1 = C[3,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0 41
1 0 22
2 0
3 0
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
9
OBST CREATION
No. of Nodes = 1
(j-i)=1
(1-0) = 1 = C[0,1] = 41
(2-1) = 1 = C[1,2] = 22
(3-2) = 1 = C[2,3] = 63
(4-3) = 1 = C[3,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0 41
1 0 22
2 0 63
3 0
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
10
OBST CREATION
No. of Nodes = 1
(j-i)=1
(1-0) = 1 = C[0,1] = 41
(2-1) = 1 = C[1,2] = 22
(3-2) = 1 = C[2,3] = 63
(4-3) = 1 = C[3,4] = 34
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0 41
1 0 22
2 0 63
3 0 34
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
11
OBST CREATION
No. of Nodes = 2
(j-i)=2
(2-0) = 2 = C[0,2]
(3-1) = 2 = C[1,3]
(4-2) = 2 = C[2,4]
Item 1 2 3 4
Key 10 20 30 40
Freq 4 2 6 3
i j 0 1 2 3 4
0 0 41
1 0 22
2 0 63
3 0 34
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
12
OBST CREATION
No. of Nodes = 2 : (1&2)
C[0,2] : i = 0; j =2; k = 1, 2;
k =1
C[0, 1-1] + C[1, 2]
= min k=2 + (W1+W2)
C[0, 2-1] + C[2, 2]
= min k= 1 (0+2)
k= 2 (0+6)
= 2 + 6 = 81
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81
1 0 22
2 0 63
3 0 34
4 0
+ (4+2)
13
OBST CREATION
No. of Nodes = 2 : (2&3)
C[1,3] : i = 1; j =3; k = 2, 3;
k =2
C[1, 2-1] + C[2, 3]
= min k=3 + (W2+W3)
C[1, 3-1] + C[3, 3]
= min k= 2 (0+6)
k= 3 (2+0)
= 2 + 8 = 103
Item 1 2 3 4
Key 10 20 30 40
Freq
(W)
4 2 6 3
i j 0 1 2 3 4
0 0 41 81
1 0 22 103
2 0 63
3 0 34
4 0
+ (2+6)
14
OBST CREATION
No. of Nodes = 2 : (3&4)
C[2,4] : i = 2; j =4; k = 3, 4;
k =3
C[2, 3-1] + C[3, 4]
= min k=4 + (W2+W3)
C[2, 4-1] + C[4, 4]
= min k= 3 (0+3)
k= 4 (6+0)
= 3 + 9 = 123
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81
1 0 22 103
2 0 63 123
3 0 34
4 0
+ (6+3)
15
OBST CREATION
No. of Nodes = 3 :
(j-i) = 3
(3-0) = 3 = C[0,3]
(4-1) = 3 = C[1,4]
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81
1 0 22 103
2 0 63 123
3 0 34
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
16
OBST CREATION
No. of Nodes = 3 : (1,2&3)
C[0,3] : i = 0; j =3; k = 1,2,3;
k =1
C[0, 1-1] + C[1, 3]
= min k=2
C[0, 2-1] + C[2, 3]
k=3 + (W1+W2+W3)
C[0, 3-1] + C[3, 3]
= min k= 1 (0+10)
k= 2 (4+6)
k= 3 (8+0)
= 8 + 12 = 203
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203
1 0 22 103
2 0 63 123
3 0 34
4 0
+ (4+2+6)
17
OBST CREATION
No. of Nodes = 3 : (2,3 & 4)
C[1,4] : i = 1; j =4; k = 2,3,4;
k =2
C[1, 2-1] + C[2, 4]
= min k=3
C[1, 3-1] + C[3, 4]
k=4 + (W2+W3+W4)
C[1, 4-1] + C[4, 4]
= min k= 2 (0+12)
k= 3 (2+3)
k= 4 (10+0)
= 5 + 11 = 163
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203
1 0 22 103 163
2 0 63 123
3 0 34
4 0
+ (2+6+3)
18
OBST CREATION
No. of Nodes = 4 :
(j-i) = 4
(4-0) = 4 = C[0,4]
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203
1 0 22 103 163
2 0 63 123
3 0 34
4 0
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
19
OBST CREATION
No. of Nodes = 4 : (1,2,3 & 4)
C[0,4] : i = 0; j =4; k = 1,2,3,4;
k=1
C[0, 1-1] + C[1, 4]
k =2
C[0, 2-1] + C[2, 4]
= min k=3
C[0, 3-1] + C[3, 4]
k=4 + (W1+W2+W3+W4)
C[0, 4-1] + C[4, 4]
= min k=1 (0+16)
k= 2 (4+12)
k= 3 (8+3)
k= 4 (20+0)
= 11 + 15 = 263
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
+ (4+2+6+3)
20
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
3
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
21
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
3
r(left, root-1) r(root, right)
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
22
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
r(left, root-1) r(root, right)
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
23
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
24
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(left, root-1) r(root, right)
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
25
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
26
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
27
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
28
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
29
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
30
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
r(1,1) r(2,2)
r(3,3) r(4,4)
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
31
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
r(0, 4)
r(0,2) r(3,4)
3
1 4
r(0,0) r(1,2)
r(left, root-1) r(root, right)
2
r(1,1) r(2,2)
r(3,3) r(4,4)
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
32
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
3
1 4
2
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
33
OBST CREATION
Item 1 2 3 4
Key 10 20 30 40
Freq (W) 4 2 6 3
i j 0 1 2 3 4
0 0 41 81 203 263
1 0 22 103 163
2 0 63 123
3 0 34
4 0
3
1 4
2
Dr. P. Subathra, KAMARAJ College of Engg &
Tech (AUTONOMOUS), Madurai,
Tamil Nadu, India
34
END…!!!

More Related Content

What's hot

Recursive algorithms
Recursive algorithmsRecursive algorithms
Recursive algorithms
subhashchandra197
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming
Fenil Shah
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
Harry Potter
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
Pranay Neema
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
Mohamed Loey
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
Rajendran
 
All pairs shortest path algorithm
All pairs shortest path algorithmAll pairs shortest path algorithm
All pairs shortest path algorithmSrikrishnan Suresh
 
Depth first search [dfs]
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]
DEEPIKA T
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
Soujanya V
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
sandeep54552
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
InteX Research Lab
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Dr Shashikant Athawale
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
Parsing
ParsingParsing
Parsing
khush_boo31
 
Knapsack problem dynamicprogramming
Knapsack problem dynamicprogrammingKnapsack problem dynamicprogramming
Knapsack problem dynamicprogramming
rowntu
 
Knapsack problem
Knapsack problemKnapsack problem
Knapsack problem
Vikas Sharma
 
Quick Sort
Quick SortQuick Sort
Quick Sort
Shweta Sahu
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 

What's hot (20)

Recursive algorithms
Recursive algorithmsRecursive algorithms
Recursive algorithms
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming01 Knapsack using Dynamic Programming
01 Knapsack using Dynamic Programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
All pairs shortest path algorithm
All pairs shortest path algorithmAll pairs shortest path algorithm
All pairs shortest path algorithm
 
Depth first search [dfs]
Depth first search [dfs]Depth first search [dfs]
Depth first search [dfs]
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
 
Parsing
ParsingParsing
Parsing
 
Knapsack problem dynamicprogramming
Knapsack problem dynamicprogrammingKnapsack problem dynamicprogramming
Knapsack problem dynamicprogramming
 
Knapsack problem
Knapsack problemKnapsack problem
Knapsack problem
 
Quick Sort
Quick SortQuick Sort
Quick Sort
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 

Similar to Optimal binary search tree dynamic programming

Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Measures of different reliability parameters for a complex redundant system u...
Measures of different reliability parameters for a complex redundant system u...Measures of different reliability parameters for a complex redundant system u...
Measures of different reliability parameters for a complex redundant system u...
Alexander Decker
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
IJERD Editor
 
Slides ads ia
Slides ads iaSlides ads ia
Slides ads ia
Arthur Charpentier
 
IA-advanced-R
IA-advanced-RIA-advanced-R
IA-advanced-R
Arthur Charpentier
 
rbs - presentation about applications of machine learning.
rbs - presentation about applications of machine learning.rbs - presentation about applications of machine learning.
rbs - presentation about applications of machine learning.
ChellamuthuMech
 
電路學 - [第七章] 正弦激勵, 相量與穩態分析
電路學 - [第七章] 正弦激勵, 相量與穩態分析電路學 - [第七章] 正弦激勵, 相量與穩態分析
電路學 - [第七章] 正弦激勵, 相量與穩態分析
Simen Li
 
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine TransformRadix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
IJERA Editor
 
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine TransformRadix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
IJERA Editor
 
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIRMATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
Editor IJMTER
 
Optimal tuning proportional integral derivative controller on direct current ...
Optimal tuning proportional integral derivative controller on direct current ...Optimal tuning proportional integral derivative controller on direct current ...
Optimal tuning proportional integral derivative controller on direct current ...
IJECEIAES
 
Radix-3 Algorithm for Realization of Discrete Fourier Transform
Radix-3 Algorithm for Realization of Discrete Fourier TransformRadix-3 Algorithm for Realization of Discrete Fourier Transform
Radix-3 Algorithm for Realization of Discrete Fourier Transform
IJERA Editor
 
VTU Affiliated Colleges
VTU Affiliated CollegesVTU Affiliated Colleges
VTU Affiliated Colleges
Mahesh Obannavar
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
sophiabelthome
 
R Matrix Math Quick Reference
R Matrix Math Quick ReferenceR Matrix Math Quick Reference
R Matrix Math Quick Reference
Mark Niemann-Ross
 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
ahmet furkan emrehan
 
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก ตัวเลขไ...
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก  ตัวเลขไ...แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก  ตัวเลขไ...
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก ตัวเลขไ...คณาธิป ยมณีย์
 

Similar to Optimal binary search tree dynamic programming (17)

Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)
 
Measures of different reliability parameters for a complex redundant system u...
Measures of different reliability parameters for a complex redundant system u...Measures of different reliability parameters for a complex redundant system u...
Measures of different reliability parameters for a complex redundant system u...
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Slides ads ia
Slides ads iaSlides ads ia
Slides ads ia
 
IA-advanced-R
IA-advanced-RIA-advanced-R
IA-advanced-R
 
rbs - presentation about applications of machine learning.
rbs - presentation about applications of machine learning.rbs - presentation about applications of machine learning.
rbs - presentation about applications of machine learning.
 
電路學 - [第七章] 正弦激勵, 相量與穩態分析
電路學 - [第七章] 正弦激勵, 相量與穩態分析電路學 - [第七章] 正弦激勵, 相量與穩態分析
電路學 - [第七章] 正弦激勵, 相量與穩態分析
 
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine TransformRadix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
 
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine TransformRadix-3 Algorithm for Realization of Type-II Discrete Sine Transform
Radix-3 Algorithm for Realization of Type-II Discrete Sine Transform
 
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIRMATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
MATHEMATICAL MODELING OF COMPLEX REDUNDANT SYSTEM UNDER HEAD-OF-LINE REPAIR
 
Optimal tuning proportional integral derivative controller on direct current ...
Optimal tuning proportional integral derivative controller on direct current ...Optimal tuning proportional integral derivative controller on direct current ...
Optimal tuning proportional integral derivative controller on direct current ...
 
Radix-3 Algorithm for Realization of Discrete Fourier Transform
Radix-3 Algorithm for Realization of Discrete Fourier TransformRadix-3 Algorithm for Realization of Discrete Fourier Transform
Radix-3 Algorithm for Realization of Discrete Fourier Transform
 
VTU Affiliated Colleges
VTU Affiliated CollegesVTU Affiliated Colleges
VTU Affiliated Colleges
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
International journal of applied sciences and innovation   vol 2015 - no 1 - ...International journal of applied sciences and innovation   vol 2015 - no 1 - ...
International journal of applied sciences and innovation vol 2015 - no 1 - ...
 
R Matrix Math Quick Reference
R Matrix Math Quick ReferenceR Matrix Math Quick Reference
R Matrix Math Quick Reference
 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
 
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก ตัวเลขไ...
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก  ตัวเลขไ...แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก  ตัวเลขไ...
แผนการจัดการเรียนรู้ที่ 1 เรื่อง การเขียนและการอ่านตัวเลขฮินดูอารบิก ตัวเลขไ...
 

More from P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai

3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
1. C Basics for Data Structures Bridge Course
1. C Basics for Data Structures   Bridge Course1. C Basics for Data Structures   Bridge Course
Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
The stable marriage problem iterative improvement method
The stable marriage problem iterative improvement methodThe stable marriage problem iterative improvement method
The stable marriage problem iterative improvement method
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Maximum matching in bipartite graphs iterative improvement method
Maximum matching in bipartite graphs   iterative improvement methodMaximum matching in bipartite graphs   iterative improvement method
Maximum matching in bipartite graphs iterative improvement method
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
Knapsack dynamic programming formula bottom up
Knapsack dynamic programming formula bottom upKnapsack dynamic programming formula bottom up
Multiplication of integers & strassens matrix multiplication subi notes
Multiplication of integers & strassens matrix multiplication   subi notesMultiplication of integers & strassens matrix multiplication   subi notes
Multiplication of integers & strassens matrix multiplication subi notes
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 

More from P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai (20)

TestFile
TestFileTestFile
TestFile
 
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
 
2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS
 
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
 
1. 6 doubly linked list
1. 6 doubly linked list1. 6 doubly linked list
1. 6 doubly linked list
 
1. 5 Circular singly linked list
1. 5 Circular singly linked list1. 5 Circular singly linked list
1. 5 Circular singly linked list
 
1. 4 Singly linked list deletion
1. 4 Singly linked list deletion1. 4 Singly linked list deletion
1. 4 Singly linked list deletion
 
1. 3 singly linked list insertion 2
1. 3 singly linked list   insertion 21. 3 singly linked list   insertion 2
1. 3 singly linked list insertion 2
 
1. 2 Singly Linked List
1. 2 Singly Linked List1. 2 Singly Linked List
1. 2 Singly Linked List
 
1. C Basics for Data Structures Bridge Course
1. C Basics for Data Structures   Bridge Course1. C Basics for Data Structures   Bridge Course
1. C Basics for Data Structures Bridge Course
 
Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
Approximation Algorithms TSP
 
The stable marriage problem iterative improvement method
The stable marriage problem iterative improvement methodThe stable marriage problem iterative improvement method
The stable marriage problem iterative improvement method
 
Maximum matching in bipartite graphs iterative improvement method
Maximum matching in bipartite graphs   iterative improvement methodMaximum matching in bipartite graphs   iterative improvement method
Maximum matching in bipartite graphs iterative improvement method
 
Knapsack dynamic programming formula bottom up
Knapsack dynamic programming formula bottom upKnapsack dynamic programming formula bottom up
Knapsack dynamic programming formula bottom up
 
Huffman tree coding greedy approach
Huffman tree coding  greedy approachHuffman tree coding  greedy approach
Huffman tree coding greedy approach
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Multiplication of integers & strassens matrix multiplication subi notes
Multiplication of integers & strassens matrix multiplication   subi notesMultiplication of integers & strassens matrix multiplication   subi notes
Multiplication of integers & strassens matrix multiplication subi notes
 
Multiplication of large integers problem subi notes
Multiplication of large integers  problem  subi notesMultiplication of large integers  problem  subi notes
Multiplication of large integers problem subi notes
 
Huffman tree coding
Huffman tree codingHuffman tree coding
Huffman tree coding
 

Recently uploaded

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 

Recently uploaded (20)

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 

Optimal binary search tree dynamic programming

  • 1. Optimal Binary Search Tree Dr. P. Subathra Prof/ IT KAMARAJ College of Engg. & Tech (AUTONOMOUS) Madurai Tamil Nadu India
  • 2. • If probabilities of searching for elements of a set are known—e.g., from accumulated data about past searches—it is natural to pose a question about an optimal binary search tree for which the average number of comparisons in a search is the smallest possible. • we limit our discussion to minimizing the average number of comparisons in a successful search. • The method can be extended to include unsuccessful searches as well. Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 2
  • 3. • The total number of binary search trees with n keys is equal to the nth Catalan number Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 3
  • 4. Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 4
  • 5. OBST CREATION (j-i)=0 Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 1 2 3 4 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 5
  • 6. OBST CREATION No. of Nodes = 0 (j-i)=0 (0-0) = 0 = C[0,0] (1-1) = 0 = C[1,1] (2-2) = 0 = C[2,2] (3-3) = 0 = C[3,3] (4-4) = 0 = C[4,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 1 0 2 0 3 0 4 0 6
  • 7. OBST CREATION No. of Nodes = 1 (j-i)=1 (1-0) = 1 = C[0,1] (2-1) = 1 = C[1,2] (3-2) = 1 = C[2,3] (4-3) = 1 = C[3,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 1 0 2 0 3 0 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 7
  • 8. OBST CREATION No. of Nodes = 1 (j-i)=1 (1-0) = 1 = C[0,1] = 41 (2-1) = 1 = C[1,2] (3-2) = 1 = C[2,3] (4-3) = 1 = C[3,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 41 1 0 2 0 3 0 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 8
  • 9. OBST CREATION No. of Nodes = 1 (j-i)=1 (1-0) = 1 = C[0,1] = 41 (2-1) = 1 = C[1,2] = 22 (3-2) = 1 = C[2,3] (4-3) = 1 = C[3,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 41 1 0 22 2 0 3 0 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 9
  • 10. OBST CREATION No. of Nodes = 1 (j-i)=1 (1-0) = 1 = C[0,1] = 41 (2-1) = 1 = C[1,2] = 22 (3-2) = 1 = C[2,3] = 63 (4-3) = 1 = C[3,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 41 1 0 22 2 0 63 3 0 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 10
  • 11. OBST CREATION No. of Nodes = 1 (j-i)=1 (1-0) = 1 = C[0,1] = 41 (2-1) = 1 = C[1,2] = 22 (3-2) = 1 = C[2,3] = 63 (4-3) = 1 = C[3,4] = 34 Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 41 1 0 22 2 0 63 3 0 34 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 11
  • 12. OBST CREATION No. of Nodes = 2 (j-i)=2 (2-0) = 2 = C[0,2] (3-1) = 2 = C[1,3] (4-2) = 2 = C[2,4] Item 1 2 3 4 Key 10 20 30 40 Freq 4 2 6 3 i j 0 1 2 3 4 0 0 41 1 0 22 2 0 63 3 0 34 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 12
  • 13. OBST CREATION No. of Nodes = 2 : (1&2) C[0,2] : i = 0; j =2; k = 1, 2; k =1 C[0, 1-1] + C[1, 2] = min k=2 + (W1+W2) C[0, 2-1] + C[2, 2] = min k= 1 (0+2) k= 2 (0+6) = 2 + 6 = 81 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 1 0 22 2 0 63 3 0 34 4 0 + (4+2) 13
  • 14. OBST CREATION No. of Nodes = 2 : (2&3) C[1,3] : i = 1; j =3; k = 2, 3; k =2 C[1, 2-1] + C[2, 3] = min k=3 + (W2+W3) C[1, 3-1] + C[3, 3] = min k= 2 (0+6) k= 3 (2+0) = 2 + 8 = 103 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 1 0 22 103 2 0 63 3 0 34 4 0 + (2+6) 14
  • 15. OBST CREATION No. of Nodes = 2 : (3&4) C[2,4] : i = 2; j =4; k = 3, 4; k =3 C[2, 3-1] + C[3, 4] = min k=4 + (W2+W3) C[2, 4-1] + C[4, 4] = min k= 3 (0+3) k= 4 (6+0) = 3 + 9 = 123 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 1 0 22 103 2 0 63 123 3 0 34 4 0 + (6+3) 15
  • 16. OBST CREATION No. of Nodes = 3 : (j-i) = 3 (3-0) = 3 = C[0,3] (4-1) = 3 = C[1,4] Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 1 0 22 103 2 0 63 123 3 0 34 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 16
  • 17. OBST CREATION No. of Nodes = 3 : (1,2&3) C[0,3] : i = 0; j =3; k = 1,2,3; k =1 C[0, 1-1] + C[1, 3] = min k=2 C[0, 2-1] + C[2, 3] k=3 + (W1+W2+W3) C[0, 3-1] + C[3, 3] = min k= 1 (0+10) k= 2 (4+6) k= 3 (8+0) = 8 + 12 = 203 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 1 0 22 103 2 0 63 123 3 0 34 4 0 + (4+2+6) 17
  • 18. OBST CREATION No. of Nodes = 3 : (2,3 & 4) C[1,4] : i = 1; j =4; k = 2,3,4; k =2 C[1, 2-1] + C[2, 4] = min k=3 C[1, 3-1] + C[3, 4] k=4 + (W2+W3+W4) C[1, 4-1] + C[4, 4] = min k= 2 (0+12) k= 3 (2+3) k= 4 (10+0) = 5 + 11 = 163 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 1 0 22 103 163 2 0 63 123 3 0 34 4 0 + (2+6+3) 18
  • 19. OBST CREATION No. of Nodes = 4 : (j-i) = 4 (4-0) = 4 = C[0,4] Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 1 0 22 103 163 2 0 63 123 3 0 34 4 0 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 19
  • 20. OBST CREATION No. of Nodes = 4 : (1,2,3 & 4) C[0,4] : i = 0; j =4; k = 1,2,3,4; k=1 C[0, 1-1] + C[1, 4] k =2 C[0, 2-1] + C[2, 4] = min k=3 C[0, 3-1] + C[3, 4] k=4 + (W1+W2+W3+W4) C[0, 4-1] + C[4, 4] = min k=1 (0+16) k= 2 (4+12) k= 3 (8+3) k= 4 (20+0) = 11 + 15 = 263 Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 + (4+2+6+3) 20
  • 21. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) 3 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 21
  • 22. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) 3 r(left, root-1) r(root, right) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 22
  • 23. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 r(left, root-1) r(root, right) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 23
  • 24. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 24
  • 25. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(left, root-1) r(root, right) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 25
  • 26. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 26
  • 27. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 27
  • 28. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 28
  • 29. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 29
  • 30. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 r(1,1) r(2,2) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 30
  • 31. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 r(1,1) r(2,2) r(3,3) r(4,4) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 31
  • 32. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 r(0, 4) r(0,2) r(3,4) 3 1 4 r(0,0) r(1,2) r(left, root-1) r(root, right) 2 r(1,1) r(2,2) r(3,3) r(4,4) Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 32
  • 33. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 3 1 4 2 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 33
  • 34. OBST CREATION Item 1 2 3 4 Key 10 20 30 40 Freq (W) 4 2 6 3 i j 0 1 2 3 4 0 0 41 81 203 263 1 0 22 103 163 2 0 63 123 3 0 34 4 0 3 1 4 2 Dr. P. Subathra, KAMARAJ College of Engg & Tech (AUTONOMOUS), Madurai, Tamil Nadu, India 34