Representation of max-heap sequentially, Data Structure & Algorithms

Q. How do we represent a max-heap sequentially? Explain by taking a valid   example.        


A max heap is also called as a descending heap, of size n is an almost complete binary tree of n nodes such as the content of each node is less than or equal to the content or matter of its father. If sequential representation of an almost whole binary tree is used, this condition reduces to the condition of inequality.

Info[j] <= info[(j-1)/2] for 0 <= ((j-1)/2) < j <= n-1

It is very much clear from this definition that root of the tree contains the largest element in the heap in the descending heap. Any of the paths from the root to a leaf is an ordered list in the descending order.





Posted Date: 7/10/2012 6:22:58 AM | Location : United States

Related Discussions:- Representation of max-heap sequentially, Assignment Help, Ask Question on Representation of max-heap sequentially, Get Answer, Expert's Help, Representation of max-heap sequentially Discussions

Write discussion on Representation of max-heap sequentially
Your posts are moderated
Related Questions
#include #include int sumFact(int numb); int calculateFactorial(int digit); main() { int numb, sumfact; do{ printf ("Enter a number 1 to 9999\n"); scanf("%

3. A function to convert a complex number in algebraic form to a complex number in phasor form

pseudo code for fibonnaci series

Explain the term - Branching There are two common ways of branching: case of ..... otherwise ...... endcase  if ..... then ..... else ..... endif   case of

include include include /* Definition of structure node */ typedef struct node { int data; struct node *next; } ; /* Definition of push function */

What are expression trees?  The leaves of an expression tree are operands, like as constants or variable names, and the other nodes have operators. This certain tree happens to

what are the applications of multikey file organization?

Algo rithm to Insert a Node p at the End of a Linked List is explained below Step1:   [check for space] If new1= NULL output "OVERFLOW" And exit Step2:   [Allocate fr

What do we mean by algorithm? What are the characteristics of a good and relevant algorithm? An algorithm is "a step-by-step procedure for finishing some task'' An algorithm c

Linear search employee an exhaustive method of verified each element in the array against a key value. Whereas a match is found, the search halts. Will sorting the array before uti