(redirected from at the bottom of the heap)
Also found in: Dictionary, Thesaurus, Idioms.


An area of memory used for dynamic memory allocation where blocks of memory are allocated and freed in an arbitrary order and the pattern of allocation and size of blocks is not known until run time. Typically, a program has one heap which it may use for several different purposes.

Heap is required by languages in which functions can return arbitrary data structures or functions with free variables (see closure). In C functions malloc and free provide access to the heap.

Contrast stack. See also dangling pointer.


A data structure with its elements partially ordered (sorted) such that finding either the minimum or the maximum (but not both) of the elements is computationally inexpensive (independent of the number of elements), while both adding a new item and finding each subsequent smallest/largest element can be done in O(log n) time, where n is the number of elements.

Formally, a heap is a binary tree with a key in each node, such that all the leaves of the tree are on two adjacent levels; all leaves on the lowest level occur to the left and all levels, except possibly the lowest, are filled; and the key in the root is at least as large as the keys in its children (if any), and the left and right subtrees (if they exist) are again heaps.

Note that the last condition assumes that the goal is finding the minimum quickly.

Heaps are often implemented as one-dimensional arrays. Still assuming that the goal is finding the minimum quickly the invariant is

heap[i] <= heap[2*i] and heap[i] <= heap[2*i+1] for all i,

where heap[i] denotes the i-th element, heap[1] being the first. Heaps can be used to implement priority queues or in sort algorithms.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)


In programming, it refers to a common pool of memory that is available to the program. The management of the heap is either done by the applications themselves, allocating and deallocating memory as required, or by the operating system or other system program.
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
References in periodicals archive ?
And as always, it's the people at the bottom of the heap who stand to lose out.
A bonus point in losing at home to Blackrock was not enough to save Dolphin, who were left floundering right at the bottom of the heap, but there was relief for Dungannon.
Politicians seem to be right at the bottom of the heap. What they are paid for TV appearances sounds like peanuts when compared with Britney Spears and Jennifer Lopez (both pounds 100,000), and Victoria and David Beckham (pounds 50,000).
The gold-laden cyanide solution is collected at the bottom of the heap, which is usually lined with plastic over a barrier such as clay.
Power and Associates of "factors showing overall satisfaction among air travelers," consumers rated frequent flier programs at the bottom of the heap, tied with airline food.
Besides, without a decent education, those at the bottom of the heap will never be able to grab new opportunities.
The first is that the reward structures of police organizations place patrol officers at the bottom of the heap, spurring the more able to escape as soon as possible.
Mexico's indigenes, who don't eat bread, are at the bottom of the heap. Mexico's multimillionaires don't eat corn.
At the bottom of the heap were common laborers, often grizzled old fellows with gnarled hands who spoke broken English.
Within the S&P 500, TripAdvisor +15.3%, Flowserve +10.8% and Microchip Technology +6.5% are tops, while Perrigo -14.4%, Wynn -12.2% are at the bottom of the heap. Tesla shares rose 1.3% on speculation the firm could join the S&P 500 after its recent governance shift and new Chairman was installed.
To be honest I think we should have a new lot of MPs taken from ordinary people that understand the ordinary folk at the bottom of the heap and not from the money grabbing, so called, welleducated monied class.