...
Binary-search-tree
November 26, 2023
Binary-search-tree
November 26, 2023
Binary-search-tree
November 26, 2023
Binary-search-tree
November 26, 2023

Data-Structures

Question 1
A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element in T?
A
B
C
D
Question 1 Explanation: 

The time complexity of searching an element in T that is smaller than the maximum element in T is O(1) time.

Example:

 

Comparing that 5<10 will take only a constant amount of time.

Correct Answer: D
Question 1 Explanation: 

The time complexity of searching an element in T that is smaller than the maximum element in T is O(1) time.

Example:

 

Comparing that 5<10 will take only a constant amount of time.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x