help in heap ! - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# help in heap !

Posts: 33Member
Hi guyz,
we know tht heap is a specialized tree-based data structure.I wish to know the answer for this qn.Let A and B be the nodes of a heap such tht B is a child of A.Heap must then satisfy the following condition.(heap property) key(A)>=key(B)

a)How many different heaps are there containing the three keys 1,2 & 3?

b)which positions cud be occupied by the 3rd largest key in a heap with 32 keys ?(where the root is counted as depth 0)

c)which positions cud be occupied by the 3rd smallest key in the heap with 32 keys??

plz help me in answering this by explanation.

• Posts: 621Member
: Hi guyz,
: we know tht heap is a specialized tree-based data structure.I wish to know the answer for this qn.Let A and B be the nodes of a heap such tht B is a child of A.Heap must then satisfy the following condition.(heap property) key(A)>=key(B)
:
: a)How many different heaps are there containing the three keys 1,2 & 3?
:
: b)which positions cud be occupied by the 3rd largest key in a heap with 32 keys ?(where the root is counted as depth 0)
:
: c)which positions cud be occupied by the 3rd smallest key in the heap with 32 keys??
:
: plz help me in answering this by explanation.
:

Homework?

Greets,
Eric Goldstein
www.gvh-maatwerk.nl