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.

Leave a Reply

Your email address will not be published. Required fields are marked *