A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Important Notice!

Dear users, compscibits.com is now permanently moved to compsciedu.com. Please update all your links and bookmarks accordingly. Soon, the site will be accessible through URL compsciedu.com only.

Discussion Forum

Que. A data structure is required for storing a set of integers such that each of the following operations can be done in (log n) time, where n is the number of elements in the set.

-Delection of the smallest element
-Insertion of an element if it is not already present in the set

Which of the following data structures can be used for this purpose?
a. A heap can be used but not a balanced binary search tree
b. A balanced binary search tree can be used but not a heap
c. Both balanced binary search tree and heap can be used
d. Neither balanced binary search tree nor heap can be used
Answer:A balanced binary search tree can be used but not a heap
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: