mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Added quick sort animation. Tweaked quick sort clarifying question.
This commit is contained in:
parent
dfd462b5db
commit
56509aaf96
|
@ -19,7 +19,7 @@
|
||||||
"source": [
|
"source": [
|
||||||
"## Clarifying Questions\n",
|
"## Clarifying Questions\n",
|
||||||
"\n",
|
"\n",
|
||||||
"* Are you looking for a naiive quicksort (ie not in-place)?\n",
|
"* Is a naiive quicksort (ie not in-place) ok?\n",
|
||||||
" * Yes"
|
" * Yes"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -40,6 +40,9 @@
|
||||||
"source": [
|
"source": [
|
||||||
"## Algorithm\n",
|
"## Algorithm\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"Wikipedia's animation:\n",
|
||||||
|
"![alt text](http://upload.wikimedia.org/wikipedia/commons/6/6a/Sorting_quicksort_anim.gif)\n",
|
||||||
|
"\n",
|
||||||
"* Set pivot to the middle element in the data\n",
|
"* Set pivot to the middle element in the data\n",
|
||||||
"* For each element:\n",
|
"* For each element:\n",
|
||||||
" * If current element is the pivot, continue\n",
|
" * If current element is the pivot, continue\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user