Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sai Kumar psvnlsaikumar

🏠
Working from home
  • Intralinks
  • Hyderabad, India
View GitHub Profile
@psvnlsaikumar
psvnlsaikumar / gist:445d0639e2e3a55dc8f7b62a720d3c4c
Created Jan 11, 2020
Binary search implementation over a rotated array
View gist:445d0639e2e3a55dc8f7b62a720d3c4c
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];