This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Illinois Institute of Technology Department of Computer Science Lecture 15: March 23, 2009 CS 430 Introduction to Algorithms Spring Semester, 2009 1 Binomial heaps Consider the following operations on heaps: MakeHeap : creates a new empty heap Insert : inserts a new element into a heap Minimum : returns the minimum element in a heap ExtractMin : returns the minimum element in a heap and removes it from the heap Union : creates a new heap consisting of the elements of two existing heaps DecreaseKey : changes the value of some element in a heap to a smaller value Delete : removes an element from a heap Recall the binary heap, as used in heapsort. 1 The binary heap can be viewed as a binary tree, although it is generally implemented as an array, where the children of element i are elements 2 i and 2 i + 1. Most of these operations can be implemented efficiently ((log n ) time or better) on a binary heap, but there is no efficient way to implement Union : the best way is to concatenate the arrays containing the two heaps and reheapify the resulting mess, requiring ( n ) time. Our goal with binomial heaps is to support all of these) time....
View
Full
Document
This note was uploaded on 04/07/2009 for the course CS 430 taught by Professor Kapoor during the Spring '08 term at Illinois Tech.
 Spring '08
 KAPOOR
 Algorithms

Click to edit the document details