Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created June 5, 2018 09:15
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 shameemreza/929553671cbf1d59599e2688979d1e21 to your computer and use it in GitHub Desktop.
Save shameemreza/929553671cbf1d59599e2688979d1e21 to your computer and use it in GitHub Desktop.
Step 1 − If it is the first element, it is
already sorted. return 1;
Step 2 − Pick next element
Step 3 − Compare with all elements in the
sorted sub-list
Step 4 − Shift all the elements in the sorted
sub-list that is greater than the
value to be sorted
Step 5 − Insert the value
Step 6 − Repeat until list is sorted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment