# Array search

**Computer Science**Level 3

Consider the problem of finding an element \(x\) in an array of size \(n\). In which of the following cases can we find the element \(x\) in \(O(\log n)\) time?

**A)** Array is sorted.

**B)** Array is sorted and is rotated by \(k\). The value of \(k\) is known.

**C)** Array is sorted and is rotated by \(k\). The value of \(k\) is unknown.

**D)** Array is not sorted.