{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS223-0212-Heap

# CS223-0212-Heap - Priority Queue and Binary Heap Neil Tang...

This preview shows pages 1–6. Sign up to view the full content.

CS223 Advanced Data Structures and Algorithms 1 Priority Queue and Binary Heap Priority Queue and Binary Heap Neil Tang Neil Tang 02/12/2008 02/12/2008

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Priority queue Binary heap Heap operations: insert, deleteMin, de/increaseKey, delete, buildHeap Application
CS223 Advanced Data Structures and Algorithms 3 Priority Queue Priority Queue A priority queue is a queue in which each element has a priority and elements with higher priorities are supposed to be removed before the elements with lower priorities.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 4 Possible Solutions Possible Solutions Linked list: Insert at the front (O(1)) and traverse the list to delete (O(N)). Linked list: Keep it always sorted. traverse the list to insert (O(N)) and delete the first element (O(1)). Binary search tree
CS223 Advanced Data Structures and Algorithms 5 Binary Heap Binary Heap

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 17

CS223-0212-Heap - Priority Queue and Binary Heap Neil Tang...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online