1.

For construction of a binary heap with property that parent node has value less than child node.In reference to that which line is incorrect. Line indexed from 1. add(int k) { heap_size++; int i = heap_size - 1; harr[i] = k; while (i != 0 && harr[parent(i)] < harr[i]) { swap(&harr[i], &harr[parent(i)]); i = parent(i); } }

A. Line -3
B. Line – 5
C. Line – 6
D. Line -7
Answer» C. Line – 6


Discussion

No Comment Found