About heap
A Heap in the context of data structure which is a tree-based data structure that satisfies the heap property where each element is assigned a key value or weighting. The lower value key always has a parent node with a higher-value key. This is called a max-Heap structure and among all nodes the root node has the highest key. Sometimes a tree-based structure has a reversed structure rule, where an element with a higher value key always has a lower value key as a parent node. This is called a min-Heap structure, and among all nodes, the root node has the lowest key. In certain programming languages including C and Pascal a Heap is an area of Pre-reserved computer main storage that a program process can use to store data in some variable amount that won't be known until the program is running. For example, a program may accept different amounts of input from one or more users for processing and then do the processing on all the input data at once.