Beap
   HOME

TheInfoList



OR:

A beap, or bi-parental heap, is a
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
for a set (or map, or multiset or multimap) that enables elements (or mappings) to be located, inserted, or deleted in sublinear time. In a beap, each element is stored in a node with up to two parents and up to two children, with the property that the value of a parent node is never greater than the value of either of its children. Beaps are implemented using an array containing only the values to be stored, with the parent-child relationships being determined implicitly by the array indices. (That is: beaps are an implicit data structure.) In that respect they are similar to
binary heap A binary heap is a heap (data structure), heap data structure that takes the form of a binary tree. Binary heaps are a common way of implementing priority queues. The binary heap was introduced by J. W. J. Williams in 1964 as a data structure fo ...
s, which are usually implemented that way as well. However, their performance characteristics are different from heaps; in particular, a beap enables sublinear retrieval of arbitrary elements. The beap was introduced by Ian Munro and Hendra Suwanda. A related data structure is the Young tableau.


Performance

The height of the structure is approximately \sqrt. Also, assuming the last level is full, the number of elements on that level is also \sqrt. In fact, because of these properties all basic operations (insert, remove, find) run in O(\sqrt) time on average. Find operations in the heap can be O(n) in the worst case. Removal and insertion of new elements involves propagation of elements up or down (much like in a heap) in order to restore the beap invariant. An additional perk is that beap provides constant time access to the smallest element and O(\sqrt) time for the maximum element. Actually, a O(\sqrt) find operation can be implemented if parent pointers at each node are maintained. You would start at the absolute bottom-most element of the top node (similar to the left-most child in a heap) and move either up or right to find the element of interest.


Applications


References

* * {{cite journal , first=J. W. J. , last=Williams , author-link=J. W. J. Williams , title=Algorithm 232 - Heapsort , date=Jun 1964 , journal=
Communications of the ACM ''Communications of the ACM'' (''CACM'') is the monthly journal of the Association for Computing Machinery (ACM). History It was established in 1958, with Saul Rosen as its first managing editor. It is sent to all ACM members. Articles are i ...
, volume=7 , issue=6 , pages=347–348 , doi = 10.1145/512274.512284 Heaps (data structures)