Fixed Python2 vs Python3 division compatibility.

This commit is contained in:
Donne Martin
2015-07-06 06:58:42 -04:00
parent 40ef096ede
commit 53f7c0e4d8
3 changed files with 6 additions and 4 deletions

View File

@@ -113,7 +113,7 @@
"def merge_sort(data):\n",
" if len(data) < 2:\n",
" return data\n",
" mid = int(len(data) / 2)\n",
" mid = len(data) // 2\n",
" left = data[0:mid]\n",
" right = data[mid:len(data)]\n",
" left = merge_sort(left)\n",

View File

@@ -94,7 +94,7 @@
" return data\n",
" left = []\n",
" right = []\n",
" pivot_index = int(len(data) / 2)\n",
" pivot_index = len(data) // 2\n",
" pivot_value = data[pivot_index]\n",
" \n",
" # Build the left and right partitions\n",