



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 overview of priority queues and heaps in the context of computer science. The fundamental operations of priority queues, the concept of heaps as complete binary trees, and the percolate up and percolate down operations. The document also discusses the vector implementation of heaps and the heap sort algorithm.
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




percolate_up( TreeNode
Suppose the following operations are applied to an initially empty binary heap of integers. Show the resulting heap after each delete_min operation. (Remember, the tree must be complete!)
push 5, push 3, push 8, push 10, push 1, push 6, pop, push 14, push 2, push 4, push 7, pop, pop, pop
push 8, push 12, push 7, push 5, push 17, push 1, pop, push 6, push 22, push 14, push 9, pop, pop,