mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Added selection sort animation. Added question about allowing duplicate values.
This commit is contained in:
parent
d909f7bfdf
commit
e2852c7ca6
|
@ -22,6 +22,8 @@
|
||||||
"* Are we sorting integers?\n",
|
"* Are we sorting integers?\n",
|
||||||
" * Yes\n",
|
" * Yes\n",
|
||||||
"* Can we assume the input is valid integers?\n",
|
"* Can we assume the input is valid integers?\n",
|
||||||
|
" * Yes\n",
|
||||||
|
"* Can we have duplicate integers?\n",
|
||||||
" * Yes"
|
" * Yes"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -42,6 +44,9 @@
|
||||||
"source": [
|
"source": [
|
||||||
"## Algorithm\n",
|
"## Algorithm\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"Wikipedia's animation:\n",
|
||||||
|
"![alt text](http://upload.wikimedia.org/wikipedia/commons/9/94/Selection-Sort-Animation.gif)\n",
|
||||||
|
"\n",
|
||||||
"We can do this recursively or iteratively. Iteratively will be more efficient as it doesn't require the extra space overhead with the recursive calls.\n",
|
"We can do this recursively or iteratively. Iteratively will be more efficient as it doesn't require the extra space overhead with the recursive calls.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"* For each element\n",
|
"* For each element\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user