question about siftdown operation on heap
- by davit-datuashvili
i have following pseudo code which execute siftdown operation on heap
array suppose is x
void siftdown(int n)
pre heap(2,n) && n>=0
post heap(1,n)
i=1;
loop
/*invariant heap(1,n) except perhaps between i and it's (0,1,or 2) children*/
c=2*i;
if (c>n)
break;
// c is left child of i
if (c+1)<=n
/* c+1 is rigth…