Question DSA-HEAP-0060
MediumWhich Python call turns a list into a heap in place in O(n)?
- A.
heapq.heapify(lst)
- B.
heapq.heappush(lst)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Heaps and Priority Queues question
Which Python call turns a list into a heap in place in O(n)?
heapq.heapify(lst)
heapq.heappush(lst)
Sign up free to see the answer and a step-by-step explanation.
sorted(lst)
lst.sort()