1.

The worst case complexity of deleting any arbitrary node value element from heap is __________(a) O(logn)(b) O(n)(c) O(nlogn)(d) O(n^2)My question is taken from Heap topic in chapter Heap of Data Structures & Algorithms IThis question was posed to me in an interview for internship.

Answer»

The correct choice is (a) O(logn)

Easy EXPLANATION - The TOTAL possible operation in DELETING the existing node and re locating new position to all its connected nodes will be EQUAL to height of the heap.



Discussion

No Comment Found

Related InterviewSolutions