1.

Which of the following is an advantage of balanced binary search tree, like AVL tree, compared to binary heap?(a) insertion takes less time(b) deletion takes less time(c) searching takes less time(d) construction of the tree takes less time than binary heapQuestion is from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms IThe question was asked by my school teacher while I was bunking the class.

Answer»

The correct choice is (a) INSERTION takes less TIME

Best EXPLANATION: Insertion and deletion, in both the binary heap and balanced binary search tree takes O(LOG n). But SEARCHING in balanced binary search tree requires O(log n) while binary heap takes O(n). Construction of balanced binary search tree takes O(nlog n) time while binary heap takes O(n).



Discussion

No Comment Found

Related InterviewSolutions