Skip to content

Instantly share code, notes, and snippets.

@ShlomiRex
Created February 25, 2017 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShlomiRex/875d4c8168bc567bfda70aab72768c2f to your computer and use it in GitHub Desktop.
Save ShlomiRex/875d4c8168bc567bfda70aab72768c2f to your computer and use it in GitHub Desktop.
Search through sorted list (ascending) By given number, find the position where the number should go. Example given array: { 1, 3, 5, 7 } Number 6 will go after index 2. (after 5 and before 7) NOTE: Array must be sorted. (Not checking) NOTE: This is my algorithm. It might not be efficient but I think its doing the job. Complexity Big-O : O(lg n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment