What is the space complexity of searching in a heap?

Answer: B
Explanation: The space complexity of searching an element in heap is O (n). Heap consists of n elements and we need to compare every element. Here no addition or deletion of elements takes place. Hence space complexity is O (n).
 

Tìm kiếm

Back
Top