The following sections of this BookRags Literature Study Guide is offprint from Gale's For Students Series: Presenting Analysis, Context, and Criticism on Commonly Studied Works: Introduction, Author Biography, Plot Summary, Characters, Themes, Style, Historical Context, Critical Overview, Criticism and Critical Essays, Media Adaptations, Topics for Further Study, Compare & Contrast, What Do I Read Next?, For Further Study, and Sources.
(c)1998-2002; (c)2002 by Gale. Gale is an imprint of The Gale Group, Inc., a division of Thomson Learning, Inc. Gale and Design and Thomson Learning are trademarks used herein under license.
The following sections, if they exist, are offprint from Beacham's Encyclopedia of Popular Fiction: "Social Concerns", "Thematic Overview", "Techniques", "Literary Precedents", "Key Questions", "Related Titles", "Adaptations", "Related Web Sites". (c)1994-2005, by Walton Beacham.
The following sections, if they exist, are offprint from Beacham's Guide to Literature for Young Adults: "About the Author", "Overview", "Setting", "Literary Qualities", "Social Sensitivity", "Topics for Discussion", "Ideas for Reports and Papers". (c)1994-2005, by Walton Beacham.
All other sections in this Literature Study Guide are owned and copyrighted by BookRags, Inc.
The heap is that part of the computer's working memory that is reserved for data whose function and size cannot be specified until a program is executed at run time. The assignment of such memory to a process at run time is carried out by means of dynamic memory allocation. A program may continue to accept data from numerous users, store them in heap storage, and wait to commence processing until all the data have been received. To set aside a particular amount of heap storage makes it easier to manage the overall storage capacity of the computer system and allows the operating system to operate more efficiently. Allocation of heap storage is performed by (1) having applications request, when needed, a certain portion of the total allowed heap (called a "heap block"), (2) having applications give their blocks to the free heap when they no longer need them, and (3) periodic reorganization of the used and unused heap blocks. To manage the heap, programming languages such as C++ include procedures for requesting, accessing, and freeing up blocks of memory.
The term heap was apparently inspired by the term stack. Stack memory is an area of memory reserved for data whose function and size can be determined when the program is compiled. As a program runs, stack memory blocks may be moved about so that small free blocks can be merged together into larger ones to meet the program's needs. In contrast to stack blocks, heap blocks are not freed in reverse of the order in which they were allocated, so free blocks may be mingled with blocks that are in use. Generally, however, stack and heap are similar enough in design that a portion of a heap (called a subheap) is usually treated like a stack.
Heapsort is an efficient sorting method used with heap storage that first arranges the address fields into a heap structure (called a binary tree) and then repeatedly removes the root of the heap as the data in the root is used (freeing up that space) and re-organizes the heap. The root is by definition the largest-valued field, always located at the top of the binary tree. A binary tree is a data structure used for sorting and storing data at nodes (or "junctions") that contain at most two leaves (data items attached to a node).