Question: Suppose the heap nodes are stored in an array, starting with index 1. Prove that the child nodes of the heap node with index i
Suppose the heap nodes are stored in an array, starting with index 1. Prove that the child nodes of the heap node with index i have index 2 · i and 2 · i + 1, and the parent node of the heap node with index i has index i/2.
Step by Step Solution
3.37 Rating (150 Votes )
There are 3 Steps involved in it
In many binary heap implementations particularly in binary heaps implemented as arrays the children and parent of a node found at index i can indeed b... View full answer
Get step-by-step solutions from verified subject matter experts
