Skip to content

Instantly share code, notes, and snippets.

@samueltcsantos
Created February 4, 2015 20: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 samueltcsantos/168fbe59e3048cbee6a7 to your computer and use it in GitHub Desktop.
Save samueltcsantos/168fbe59e3048cbee6a7 to your computer and use it in GitHub Desktop.
> python mergesort.py
[2, 0, 9, 6, 4, 3, 5, 8, 1, 7]
[2, 0, 9, 6, 4]
[2, 0]
[2]
[0]
Merged [0, 2]
[9, 6, 4]
[9]
[6, 4]
[6]
[4]
Merged [4, 6]
Merged [4, 6, 9]
Merged [0, 2, 4, 6, 9]
[3, 5, 8, 1, 7]
[3, 5]
[3]
[5]
Merged [3, 5]
[8, 1, 7]
[8]
[1, 7]
[1]
[7]
Merged [1, 7]
Merged [1, 7, 8]
Merged [1, 3, 5, 7, 8]
Merged [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment