• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
May 26, 2022 |20.3K Views

Find the Rotation Count in Rotated Sorted array

Description
Discussion

Consider an array arr of distinct numbers sorted in increasing order. Given that this array has been rotated (clockwise) k number of times. Given such an array, find the value of k.

Examples:  

Input: arr[] = {15, 18, 2, 3, 6, 12}
Output: 2
Explanation: Initial array must be {2, 3, 6, 12, 15, 18}. We get the given array after rotating the initial array twice.

Find the Rotation Count in Rotated Sorted array : https://www.geeksforgeeks.org/find-rotation-count-rotated-sorted-array/