Why move right = mid when nums[mid] is not greater than nums[right]?

Practice this question from Find Minimum in Rotated Sorted Array - Rotated minimum Pattern Practice Quiz, with options and an explanation.

Question

Why move right = mid when nums[mid] is not greater than nums[right]?

Option A — Correct answer

Because mid may be the minimum

Option B

Because mid is always too large

Option C

Because right is never needed

Option D

Because duplicates are required

Explanation

Mid may itself be the minimum, so it must remain in the search range.

Find Minimum in Rotated Sorted Array - Rotated minimum Pattern Practice Quiz

All questions · Previous question

Open on QuizMaker