Join WhatsApp ChannelDaily MCQs & Exam Updates
Computer Science Easy ppsc

What is the time complexity of binary search on a sorted array?

  • A O(log n)
  • B O(1)
  • C O(n)
  • D O(n^2)
Correct Answer: Option A — O(log n)
Explanation:
Binary search has a time complexity of O(log n) because it repeatedly divides the search interval in half, eliminating half of the remaining...
Submitted by: PaperMCQs
Related MCQs