






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth analysis of priority queues, their applications, and binary heap implementations. It covers topics such as motivations, model, simple implementations, and various types of heaps. The document also discusses the heap order property, basic heap operations, and other heap operations. Use cases of priority queues, such as the selection problem, are explained with two different algorithms.
Typology: Slides
1 / 38
This page cannot be seen from the preview
Don't miss anything!































7/7/2012 Priorty Queues 6-
EE 232 Data Structures Session-05 , Spring-
7/7/2012 Priorty Queues 6-
front rear
7/7/2012 Priorty Queues 6-
7/7/2012 Priorty Queues 6-
6.1 Model
6.2 Simple Implementations
6.3 Binary Heap
6.4 Applications of Priority Queues
6.5 d - Heaps
6.6 Leftist Heaps
6.7 Skew Heaps
6.8 Binomial Queues
7/7/2012 Priorty Queues 6-
6.1 Model
6.2 Simple Implementations
6.3 Binary Heap
6.4 Applications of Priority Queues
6.5 d - Heaps
6.6 Leftist Heaps
6.7 Skew Heaps
6.8 Binomial Queues
7/7/2012 Priorty Queues 6-
Basic model of a priority queue
7/7/2012 Priorty Queues 6-
7/7/2012 Priorty Queues 6-
7/7/2012 Priorty Queues 6-
7/7/2012 Priorty Queues 6-
7/7/2012 Priorty Queues 6-
Structure property Heap order property
height of a complete binary tree is log N which is O (log N )
7/7/2012 Priorty Queues 6-
*http://www.ece.uwaterloo.ca/~ece250/
For each depth, starting at zero: visit the nodes in the order from left to right
7/7/2012 Priorty Queues 6-
*http://www.ece.uwaterloo.ca/~ece250/ docsity.com
7/7/2012 Priorty Queues 6-
The left child is in position 2i The right child is in position 2i+ The parent is in position i/2
i << 1 = 2i i >> 1 = i/2