Solution to Min Number In Rotated Array from Jobdu

1 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1386

Question Name: Min Number In Rotated Array

Question Description: the input array is sorted and then rotated. Write a function to find the minimum value in the array.

Input: may contains multiple test cases. For each case, the first line is an integer N, saying the number of elements in the array. The second line contains  N integers as the content of the array.

Output: the minimum value in each test case.

This question is quite similar with the challenge Search in Rotated Sorted Array from LeetCode.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!