      "collapsed": false
     },
     "outputs": [],
     "source": [
      "def selection_sort(data, start=0):\n",
      "    # TODO: Implement me (recursive)\n",
      "    pass"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": null,
     "metadata": {
      "collapsed": true
     },
     "outputs": [],
     "source": [
      "def selection_sort_iterative(data):\n",
      "    # TODO: Implement me (iterative)\n",
      "    pass"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
 
</s> remove    "execution_count": 3,
 </s> add    "execution_count": 2, </s> remove    "execution_count": 4,
 </s> add    "execution_count": 3, </s> remove     "def selection_sort(data):\n",
    "    if data is None or len(data) < 2:\n",
    "        return\n",
    "    for i in range(len(data)-1):\n",
    "        min_index = i\n",
    "        for j in range(i + 1, len(data)):\n",
    "            if data[j] < data[min_index]:\n",
    "                min_index = j\n",
    "        data[i], data[min_index] = data[min_index], data[i]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Below are alternate solutions with helper functions:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def find_min_index(data, start):\n",
    "    # Raises an exception if: \n",
    "    # -data is None\n",
    "    # -start >= len(data) - 1\n",
    "    min_index = start\n",
    "    for i in range(start + 1, len(data)):\n",
    "        if data[i] < data[min_index]:\n",
    "            min_index = i\n",
    "    return min_index\n",
 </s> add     "class SelectionSort(object):\n", </s> remove     "from nose.tools import assert_equal\n",
 </s> add     "from nose.tools import assert_equal, assert_raises\n", </s> remove     "def selection_sort_iterative_alt(data):\n",
    "    if data is None or len(data) < 2:\n",
    "        return\n",
    "    for i in range(len(data)-1):\n",
    "        swap(data, i, find_min_index(data, i))"
 </s> add     "    def _swap(self, data, i, j):\n",
    "        if i != j:\n",
    "            data[i], data[j] = data[j], data[i]\n",
    "        return data"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
      "collapsed": false
     },
     "outputs": [],
     "source": [
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
    "class SelectionSort(object):\n",
    "\n",
    "    def sort(self, data):\n",
    "        # TODO: Implement me (recursive)\n",
    "        pass"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Update selection sort challenge (#131)

Update constraints, test cases, code, and tests. 
sorting_searching/selection_sort/selection_sort_challenge.ipynb