Beginner friendly C++ Binary Search solution - O(logN)
Sorted array after rotation will have 2 parts , both sorted in ascending order.\n   For eg: [1,2,3,4,5] after rotating 2 times will become [4,5,1,2,3].  Here fi
* Sorted array after rotation will have 2 parts , both sorted in ascending order.\n   For eg: [1,2,3,4,5] after rotating 2 times will become [4,5,1,2,3].  Here first part is [4,5] and second       part is [1,2,3]. \n* Basically we have to find first element of second part. \n* It might also be possible that after several rotations we might get sorted array again. To handle this we\'ll first check if first element is samller than the last element. If it is so then the array is sorted and will return first element.\n* We can apply modified version of binary search to solve this question.\n* We will first find mid , which is (start+end)/2. Then we\'ll check whether our mid lies in the first part or second.\n* If nums[mid] >= nums[0] then mid lies in first part otherwise in second part.\n* If our mid lies in first part then we will make start = mid +1 (since our ans always lies in second part).\n* If it lies in second part then will update our ans and make end = mid - 1.\n\n```\nint findMin(vector<int>& nums) {\n        int n = nums.size();\n        \n\t\t//if size of array is one\n        if(n==1)\n            return nums[0];\n        \n        //if array is sorted then first element is smallest\n        if(nums[0] < nums[n-1])\n            return nums[0];\n        \n        int start = 0;\n        int end = n-1;\n        \n        int ans = INT_MAX;\n        while(start <= end){\n            \n            int mid = (start + end) / 2;\n\t\t\t\n\t\t\t//if mid is in first part of array\n            if(nums[mid] >= nums[0])\n                start = mid +1;\n            \n            else\n            {\n                ans = min(ans , nums[mid]);\n                end = mid - 1;\n            }\n        }\n        return ans;\n    }\n```\n\nTime Complexity : O(logn)\n\n***If you like the solution please upvote!***
['C', 'Binary Tree']