6.006- Introduction to
Algorithms
Lecture 4
1
Courtesy of MIT Press. Used with permission.
6.006- Introduction to Algorithms Courtesy of MIT Press. Used with - - PowerPoint PPT Presentation
6.006- Introduction to Algorithms Courtesy of MIT Press. Used with permission. Lecture 4 1 Menu Priority Queues Heaps Heapsort 2 Priority Queue A data structure implementing a set S of elements, each associated with a key,
1
Courtesy of MIT Press. Used with permission.
2
3
16 14 10 8 7 9 3 2 4 1 16 14 10 8 7 9 3 2 4 1
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
4
16 14 10 8 7 9 3 2 4 1 16 14 10 8 7 9 3 2 4 1
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
5
6
7
Node 10 is the left child of node 5 but is drawn to the right for convenience
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
MIT OpenCourseWare http://ocw.mit.edu
6.006 Introduction to Algorithms
Fall 2011 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.