heap

(redirected from heaped upon)
Also found in: Dictionary, Thesaurus, Legal.

heap

(programming)
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.

heap

(programming)
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.

heap

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.
References in classic literature ?
If Julian's confidence in her was a confidence soundly placed, she would nobly pardon the outrages that had been heaped upon her, and she would do justice to the woman whom she had wronged.
But the wrongs society has heaped upon me are treasured in this breast.
The house, with gable and chimney, and tower, and turret, and dark doorway, and broad terrace-walk, twining among the balustrades of which, and lying heaped upon the vases, there was one great flush of roses, seemed scarcely real in its light solidity and in the serene and peaceful hush that rested on all around it.
Every movable was packed off, as if it were dismissed from public life for evermore; the floor was swept and watered, the lamps were trimmed, fuel was heaped upon the fire; and the warehouse was as snug, and warm, and dry, and bright a ball-room, as you would desire to see upon a winter's night.
He fell backwards to the ground, and Menelaus set his heel upon him, stripped him of his armour, and vaunted over him saying, "Even thus shall you Trojans leave the ships of the Achaeans, proud and insatiate of battle though you be, nor shall you lack any of the disgrace and shame which you have heaped upon myself.
Necklaces of lion and tiger-teeth, bits of dried meat, finely tanned hides and earthen pots, beautifully decorated, they thrust upon us until we were loaded down, and all the while Al-tan glared balefully upon us, seemingly jealous of the attentions heaped upon us because we had served Chal-az.
The ministers poured forth a recital of all the indignities and wrongs that had been heaped upon them.
Bradley felt his blood boil at sight of the cowardly indignities being heaped upon his men, and in the brief span of time occupied by the column to come abreast of where he lay hidden he made his plans, foolhardy though he knew them.
This is due, of course, to numerous unfortunate realities, not the least of which being the combination of scorn heaped upon ragtime as a popular and, thus, lesser art, and the almost complete erasure of ragtime from music historical records in the first quarter of this century.
that is being heaped upon the previously independent physician's office.
Two archaeologists at the University of Michigan in Ann Arbor charge that the McCaffertys parlayed a political concern about inequities heaped upon women in ancient and modern societies into a "massaging" of Caso's data to promote a vision of once-powerful Mixtec women.
Tautology heaped upon tautology, laying waste to meaning beyond the painting-as-thing.