两个不相关的概念,称呼相同罢了。
heap
n.
1.A portion of memory reserved for a program to use for the temporary storage of data structures whose existence or size cannot be determined until the program is running. To build and use such elements, programming languages such as C and Pascal include functions and procedures for requesting free memory from the heap, accessing it, and freeing it when it is no longer needed. In contrast to stack memory, heap memory blocks are not freed in reverse of the order in which they were allocated, so free blocks may be interspersed with blocks that are in use. As the program continues running, the blocks may have to be moved around so that small free blocks can be merged together into larger ones to meet the program’s needs. See also garbage collection. Compare stack.
2. A complete binary tree in which the value of any node is not exceeded by the value of either of its children. See also binary tree.