Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS2420: Lecture 19 Vladimir Kulyukin Computer Science Department Utah State University.

Similar presentations


Presentation on theme: "CS2420: Lecture 19 Vladimir Kulyukin Computer Science Department Utah State University."— Presentation transcript:

1 CS2420: Lecture 19 Vladimir Kulyukin Computer Science Department Utah State University

2 Outline Binary Search Trees (Chapter 4) HeapSort (Chapter 7)

3 Binary Search Tree: Average Case Analysis Recall that the depth of the node is the length of the unique path from the root to that node. The sum of the depths of all nodes in the tree is the internal path length. The average case makes the assumption that all possible insertion/deletion sequences are equally likely.

4 Binary Search Tree: Average Case Analysis

5

6

7

8 The Heap-Order Property A Heap is a Complete Binary Tree. The Heap-Order Property: –In a heap, for every node X with parent P, the key in P is smaller than or equal to the key in X (minimal heap). –In a heap, for every node X with parent P, the key in P is greater than or equal to the key in X (maximum heap).

9 The Heap-Order Property P X P X The minimum heap-order property The maximum heap-order property


Download ppt "CS2420: Lecture 19 Vladimir Kulyukin Computer Science Department Utah State University."

Similar presentations


Ads by Google