





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
W7(b) Lecture Notes (Skrentny) Material Type: Notes; Class: Introduction to Data Structures; Subject: COMPUTER SCIENCES; University: University of Wisconsin - Madison; Term: Spring 2014;
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Homework h5 assigned tomorrow Program p2 due 10 pm Sunday, March 9th • submit java files to your “in” directory
Program p3 assigned this weekend^ •^ partners? only ONE submits source but BOTH submit README.txt Last Time • exam mechanics
Today Priority Queue ADT
Priorities
Concept
Operations
data structure insert^ removeMax^ notes
unordered array
ordered array
chain of nodes^ unordered
chain of nodes^ ordered
A B C D
E
F
G
H
J I
Algorithm
Given the following max heap:
Show the heap after inserting 36:
Show the heap after inserting 57:
Heap Class Instance Variables: privateprivate Comparable[]int nextLoc; items;
Pseudo-code public void insert(Comparable data) {
Complexity