Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
is it O(N) or O(N*logN)?

Baraa Attabbaa

Sep 17, 2023

Initializing the min-heap with all numbers will take O(N)

0

0

Comments
Comments
Shubham Vora
Shubham Voraa year ago
  1. Heapify an Entire Array:

    • You build a heap from an unsorted array using the bottom-up approach. The heapify operation for each node is performed in a way that the overall complexity for this process is linear, O(n). This is due to the nature of the hea...

On this page