chore: fix some comments (#5333)

This commit is contained in:
mountdisk
2024-08-17 01:19:15 +08:00
committed by GitHub
parent 98bee26d51
commit 7c58b190c8
5 changed files with 5 additions and 5 deletions

View File

@ -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].