For [4,5,6,7,0,1,2] and target 0, what index is returned?

Practice this question from Search in Rotated Sorted Array - Rotated search Pattern Practice Quiz, with options and an explanation.

Question

For [4,5,6,7,0,1,2] and target 0, what index is returned?

Option A

0

Option B

2

Option C — Correct answer

4

Option D

-1

Explanation

The target 0 is at index 4.

Search in Rotated Sorted Array - Rotated search Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker