Searching Algorithms: Binary Search - Applications - Competitive Exam Level

Download Q&A
Q. How can binary search be modified to find the first occurrence of a target value in a sorted array with duplicates?
  • A. Use a linear search
  • B. Modify the mid-point logic
  • C. Use a stack
  • D. Use a queue
Q. What happens if you apply binary search on a sorted array with duplicate elements?
  • A. It finds the first occurrence
  • B. It finds the last occurrence
  • C. It can find any occurrence
  • D. It fails
Q. Which of the following is a valid application of binary search?
  • A. Finding the square root of a number
  • B. Finding an element in a sorted array
  • C. Sorting an array
  • D. Searching in a hash table
Showing 1 to 3 of 3 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely