This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 1 *2+2 2 *2++2 h-2 *2+2 h-1 *2+2 h *2 = -2h+2(2 1 +2 2 ++2 h ) = -2h+2(2 +2 1 +2 2 ++2 h )-2 = -2h+2(n)-2 h->O(logn) n-> O(n) O(n) o Linear time build heap Heap Review Insert o O(log n) deleteMax o O(log n) Building a heap out of a set of (item priority entries) o Repeated inserts O(n logn) Know/derive o Repeated sift down: O(n) Know/Derive Updating priority of item in heap If K is leaf, 2k+1>=n n= size of array...
View Full Document
This note was uploaded on 02/29/2012 for the course 198 112 taught by Professor Venugopal during the Spring '09 term at Rutgers.
- Spring '09