Presentation is loading. Please wait.

Presentation is loading. Please wait.

Topic 10 Trees.

Similar presentations


Presentation on theme: "Topic 10 Trees."— Presentation transcript:

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

8

9 Search

10

11 Insertion

12

13 Deletion Need Min/max Successor/predecessor

14

15

16 Pseudocode

17 Pseudocode

18 AVL

19 Height of AVL Tree

20 Proof

21

22 Insertion

23 Example

24 Single Right

25 Left-Right

26 Four cases

27 Deletions

28 Example

29

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

39

40

41

42

43 Deletion

44

45

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)

57

58

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

66

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

71

72

73 2-3 Trees A search tree Properties

74

75 Insertion

76

77 Deletion Remove Borrow Coalesce Apply recursively

78 Remove

79 Borrow

80 Coalesce

81 Generalizing/Example

82

83

84

85

86

87

88

89

90 2-3-4 trees, B-trees Why use 2-3 trees?

91

92


Download ppt "Topic 10 Trees."

Similar presentations


Ads by Google