diff --git a/sorting_searching/merge_sort/merge_sort_solution.ipynb b/sorting_searching/merge_sort/merge_sort_solution.ipynb index 3d721a4..93da0ea 100644 --- a/sorting_searching/merge_sort/merge_sort_solution.ipynb +++ b/sorting_searching/merge_sort/merge_sort_solution.ipynb @@ -33,7 +33,6 @@ "source": [ "## Constraints\n", "\n", - "* Is a naiive solution sufficient?\n", " * Yes" ] @@ -87,6 +86,9 @@ }, "outputs": [], "source": [ + "from __future__ import division\n", + "\n", + "\n", "def merge(left, right):\n", " l = 0\n", " r = 0\n", @@ -111,7 +113,7 @@ "def merge_sort(data):\n", " if len(data) < 2:\n", " return data\n", - " mid = len(data) / 2\n", + " mid = int(len(data) / 2)\n", " left = data[0:mid]\n", " right = data[mid:len(data)]\n", " left = merge_sort(left)\n",