Skip to content

Instantly share code, notes, and snippets.

View psvnlsaikumar's full-sized avatar

Sai Kumar psvnlsaikumar

  • Hyderabad, India
View GitHub Profile
@psvnlsaikumar
psvnlsaikumar / gist:445d0639e2e3a55dc8f7b62a720d3c4c
Created January 11, 2020 10:33
Binary search implementation over a rotated array
public static int search(final int[] A, int B) {
int index = -1;
int pivot = pivotSearch(A);
int low = pivot;
int high = pivot - 1;
int pivotRightBoundary = A[A.length - 1];
int pivotLeftBoundary = A[0];