Single Choice
Easy
QWhat is the time complexity of searching for an element in a sorted array using binary search?
ID: #15242
Time Complexity
156 views
Question Info
#15242Q ID
EasyDifficulty
Time ComplexityTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Binary search is an efficient search algorithm that operates on sorted arrays by repeatedly dividing the search interval in half. In each iteration, it compares the middle element with the target element and adjusts the search range accordingly. This process continues until the target element is found or the search range becomes empty. Since each comparison reduces the search space by half, the time complexity of binary search is logarithmic with respect to the number of elements in the array, denoted as O(log n).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic