Download presentation
Presentation is loading. Please wait.
1
Topic 10 Trees
2
Tree Definitions
3
Tree Definitions
4
Tree Definitions
5
Binary Search Tree
6
Traversal Operations tree
7
Announcements Participation 4 is up Homework 3 grading
9
Search
11
Insertion
13
Deletion Need Min/max Successor/predecessor
16
Pseudocode
17
Pseudocode
18
AVL
19
Height of AVL Tree
20
Proof
22
Insertion
23
Example
24
Single Right
25
Left-Right
26
Four cases
27
Deletions
28
Example
30
Announcements Test in 2 weeks Participation due tomorrow Clarification
31
Splay Trees
32
Amortized Running Time
Runtime:
33
Basic Operations
34
When to Splay
35
Zig
36
Zig-Zag
37
Zig-zig
38
Example
43
Deletion
46
Optimal BST
47
Notation
48
Example
49
Example
50
More Notation (i,j) (j+1, j)
51
Observations
52
Observations
53
Announcements Participation due
Clarifications on previous topics today Splay tree deletion Universal Hashing
54
Guaranteeing O(n) time
55
Birthday Paradox
56
Universal Hashing (clarification)
59
Computing the Optimal BST
How to compute cost? Subtree at different depths
60
w(i,j)
61
AST
62
AST
63
Example Sequences/Probabilities
64
Leaves
65
The Big Idea
67
Subtrees with one key
68
Subtrees with 2 keys
69
Solution
70
Announcements Homework 5 due Homework 6 up
Solutions will be up later today Homework 6 up
73
2-3 Trees A search tree Properties
75
Insertion
77
Deletion Remove Borrow Coalesce Apply recursively
78
Remove
79
Borrow
80
Coalesce
81
Generalizing/Example
90
2-3-4 trees, B-trees Why use 2-3 trees?
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.