For Construction Of A Binary Heap With Property That Parent #900

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.</p> <pre><code class="language-java"> 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. } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Heap - Binary Heap - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs121 Data Structures and Algorithms

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background