Fill in the blanks in the procedure:
void
Prod (Element Type X, Priority Queue H)
{
int i;
if (IsFull(H))
{
Error ("Priority queue is full");
return;
}
for (i=++H -> size; H -> Elements [i/2]>X; i/=2)
_________________
}
Find the statement which has to be placed below the for loop for inserting a key.
- $H$$\rightarrow$ Elements $[i]=H$ $\rightarrow$ Elements [i/2]; $H$ $\rightarrow$Elements $[i] = X$;
- $H$$\rightarrow$ Elements $[i/2]=H$$\rightarrow$ Elements $[i/2]$;
- $H$$\rightarrow$ Elements $[i^2 ]=X;$
- $H$$\rightarrow$ Elements $[i]=X;$