Skip to content

Instantly share code, notes, and snippets.

@ramntry
Created November 16, 2011 19:39
Show Gist options
  • Select an option

  • Save ramntry/1371102 to your computer and use it in GitHub Desktop.

Select an option

Save ramntry/1371102 to your computer and use it in GitHub Desktop.
qsort trace
10 4 3 10 2
call #1. Base: 5
1: ^10 4 3 10 2$
swap
2: ^2 4 3 10 10$
3: 2 ^4 3 10 10$
4: 2 4 ^3 10 10$
5: 2 4 3 ^10 10$
6: 2 4 3 ^10$ 10
call #2. Base: 5
7: ^2 4 3 10$
8: 2 ^4 3 10$
9: 2 4 ^3 10$
10: 2 4 ^3$ 10
call #3. Base: 3
11: ^2 4 3$
12: 2 ^4 3$
swap
13: 2 ^3 4$
call #4. Base: 2
14: ^2 3$
15: ^2$ 3
call #5. Base: 4
16: ^4$
call #6. Base: 6
17: ^4 10$
18: ^4$ 10
call #7. Base: 10
19: ^10 10$
2 3 4 10 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment