
324 Data Structures Using C
}
}
}
void dispHeap (int heap[])
{
int i;
for (i = 1; i <= heap[0]; i++)
printf (“%d “, heap[i]);
}
e above program was tested for the input: 22 15 56 11 7 90 44
e output obtained is: 90 15 56 11 7 22 44, which is found to be correct.
In the next run, 89 was added to the list, i.e., 22 15 56 11 7 90 44 89.
We nd that the item ‘89’ has been inserted at proper place as indicated by the output obtained
thereof: 90 89 56 15 7 22 44 11
It is le as an exercise for the reader to verify above results.
7.5.3.3 Deletion of a Node from a Heap Tree The deletion operation on heap tree is relevant when
its root is deleted. ...