Select the correct option to test your answer:
Computer
Heaps
Difficulty: Medium
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. 1. add(int k) 2. { 3. heap_size++; 4. int i = heap_size - 1; 5. harr[i] = k; 6. while (i != 0 && harr[parent(i)] < harr[i]) 7. { 8. swap(&harr[i], &harr[parent(i)]); 9. i = parent(i); 10. } 11. }
More Computer Questions
What is necessary when we need to create a new field in craft?
Which of the following is true about the ensure keyword in Ruby exception handling?
. . . . . . . . function gives an error message if the desired package cannot be loaded.
What will be the output of the following Java program? class Output { public static void main(String args[]) { ArrayList obj = new ArrayList(); obj.add("A"); obj.add("D"); obj.ensureCapacity(3); obj.trimToSize(); System.out.println(obj.size()); } }
Which of these cannot be declared static?