From e2852c7ca650b0cc352f265e812552f0a04b440c Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Wed, 27 May 2015 07:13:28 -0400 Subject: [PATCH] Added selection sort animation. Added question about allowing duplicate values. --- sorting-searching/selection-sort.ipynb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sorting-searching/selection-sort.ipynb b/sorting-searching/selection-sort.ipynb index b512981..f3cce80 100644 --- a/sorting-searching/selection-sort.ipynb +++ b/sorting-searching/selection-sort.ipynb @@ -22,6 +22,8 @@ "* Are we sorting integers?\n", " * Yes\n", "* Can we assume the input is valid integers?\n", + " * Yes\n", + "* Can we have duplicate integers?\n", " * Yes" ] }, @@ -42,6 +44,9 @@ "source": [ "## Algorithm\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", "\n", "* For each element\n",