Why Is Heap Implemented Using Array Representations Than #492

Why is heap implemented using array representations than tree(linked list) representations though both tree representations and heaps have same complexities?</p> <pre><code class="language-java"> for binary heap -insert: O(log n) -delete min: O(log n) for a tree -insert: O(log n) -delete: O(log n) </code></pre> <p>Then why go with array representation when both are having same values ?

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 Binary Trees - Binary Trees using Array - Quiz No.1.

Why is heap implemented using array representations than tree(linked list) representations though both tree representations and heaps have same complexities?

 for binary heap -insert: O(log n) -delete min: O(log n)  for a tree -insert: O(log n) -delete: O(log n) 

Then why go with array representation when both are having same values ?


Similar question(s) are as followings:



Online Quizzes of gs121 Data Structures and Algorithms

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background