mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 05:59:22 +08:00
chore: fix some comments (#5333)
This commit is contained in:
@ -17,7 +17,7 @@ import java.util.Scanner;
|
||||
from its initial sorted position.
|
||||
Eg. For [2,5,6,8,11,12,15,18], 1 rotation gives [5,6,8,11,12,15,18,2], 2 rotations
|
||||
[6,8,11,12,15,18,2,5] and so on. Finding the minimum element will take O(N) time but, we can use
|
||||
Binary Search to find the mimimum element, we can reduce the complexity to O(log N). If we look
|
||||
Binary Search to find the minimum element, we can reduce the complexity to O(log N). If we look
|
||||
at the rotated array, to identify the minimum element (say a[i]), we observe that
|
||||
a[i-1]>a[i]<a[i+1].
|
||||
|
||||
|
Reference in New Issue
Block a user