int int sravn int prisv for arr Length i-- siftDown arr arr Length sra

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
int i;
int sravn = 0;
int prisv = 0;
for (i = arr.Length / 2 - 1; i >= 0; i--)
{
siftDown(arr, i, arr.Length);
sravn += 3;
prisv += 1;
}
for (i = arr.Length - 1; i >= 1; i--)
{
swap(ref arr[0],ref arr[i]);
siftDown(arr, 0, i);
sravn += 6;
prisv += 1;
}