Topic 11 Heaps and Tries
Announcements Grading Homework 5 solutions will be up today Homework 3 to be graded by today Homework 4 to be graded tomorrow/Thursday Homework 5 solutions will be up today Test in 1.5 weeks Online students: make sure you can take the test on Thursday/Friday. Participation Schedule
Homework 5 solutions
Heaps Priority Queues Definition:
Heap Property
Representation/Implementation
Array attributes
Example representation
Calculating Parent/Child
Heap Operations: Insertion
Pseudocode
Heap Operations: delete-max/min
Announcements Mid-semester Survey (soon) Practice quizzes to be posted Participation questions?
Heap Operations: build-heap
Example
Pseudocode
Heap Sort
Basic Idea
Example
Pseudocode
Stability Original Sorted
Tries
Definition Definition:
Adding fixed-length keys
Alphabet Trie (alphabet from English alphabet)
Analysis (compressed tries) Search Insertion # nodes s
Uses Sort? Search?
Announcements Participation due Past quizzes and survey are up No more programs Test is next week Online students: take midterm the same time as midterm 1 Heap sort best case – O(nlogn)
Participation (problem 1)
Participation (problem 2)
Searching for Suffixes
Example