📚 Question Bank Q78 — Algorithms
Tags
Algorithms
Q78. Marks: +2.0 UGC NET Paper 2: Computer Science 26th Nov 2021

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

A. Deletion of the smallest element

B. 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?

1.A heap can be used but not a balanced binary search tree.
2.A balanced binary search tree can be used but not a heap. ✓ Correct
3.Both balanced binary search tree and heap can be used.
4.Neither balanced binary search tree nor heap can be used.
📄 All “Algorithms” questions across papers
🏷 Change Tag for this Question