...
Question 965 – Nielit Scientist-B IT 4-12-2016
December 3, 2023
Question 1087 – Nielit Scientist-B CS 22-07-2017
December 3, 2023
Question 965 – Nielit Scientist-B IT 4-12-2016
December 3, 2023
Question 1087 – Nielit Scientist-B CS 22-07-2017
December 3, 2023

Question 16235 – UGC NET Dec-2020 and June-2021 Paper-2

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

Correct Answer: A

Question 15 Explanation: 
A Balanced Binary Tree is nothing but an AVL Tree. And Time complexity of an AVL tree for finding an element is (Log n) in the worst case. Heaps are good only for min/max elements. Min heap will have minimum element on root and max element will have maximum at root. But to insert an element which may or may not be present in the heap will take O (N) in the worst case because we need to check all the elements of the heap.
A
A balanced binary search tree can be used but not a heap.
B
A heap can be used but not a balanced binary search tree.
C
Both balanced binary search tree and heap can be used.
D
Neither balanced binary search tree nor heap can be used.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!