mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-09 02:48:02 +00:00
Added selection sort animation. Added question about allowing duplicate values.
This commit is contained in:
@@ -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",
|
||||||
|
"\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",
|
||||||
|
|||||||
Reference in New Issue
Block a user