NASA Logo

NTRS

NTRS - NASA Technical Reports Server

Press Enter or click the Search button to begin your search.

Back to Results
Efficient Merge and Insert Operations for Binary Heaps and TreesBinary heaps and binary search trees merge efficiently. We introduce a new amortized analysis that allows us to prove the cost of merging either binary heaps or balanced binary trees is O(l), in the amortized sense. The standard set of other operations (create, insert, delete, extract minimum, in the case of binary heaps, and balanced binary trees, as well as a search operation for balanced binary trees) remain with a cost of O(log n). For binary heaps implemented as arrays, we show a new merge algorithm that has a single operation cost for merging two heaps, a and b, of O(absolute value of a + min(log absolute value of b log log absolute value of b. log absolute value of a log absolute value of b). This is an improvement over O(absolute value of a + log absolute value of a log absolute value of b). The cost of the new merge is so low that it can be used in a new structure which we call shadow heaps. to implement the insert operation to a tunable efficiency. Shadow heaps support the insert operation for simple priority queues in an amortized time of O(f(n)) and other operations in time O((log n log log n)/f (n)), where 1 less than or equal to f (n) less than or equal to log log n. More generally, the results here show that any data structure with operations that change its size by at most one, with the exception of a merge (aka meld) operation, can efficiently amortize the cost of the merge under conditions that are true for most implementations of binary heaps and search trees.
Document ID
20000115620
Acquisition Source
Ames Research Center
Document Type
Preprint (Draft being sent to journal)
Authors
Kuszmaul, Christopher Lee
(MRJ Technology Solutions Moffett Field, CA United States)
Woo, Alex C.
Date Acquired
September 7, 2013
Publication Date
January 1, 2000
Subject Category
Theoretical Mathematics
Funding Number(s)
PROJECT: RTOP 509-10-61
Distribution Limits
Public
Copyright
Work of the US Gov. Public Use Permitted.
No Preview Available