From aac224dc1b0c968ed52ab1d14332c4d9742f5d71 Mon Sep 17 00:00:00 2001 From: Sayan Bandyopadhyay Date: Thu, 12 Oct 2017 01:28:12 +0530 Subject: [PATCH] Update radix_sort.py This will fix the error in the list index showing as float --- sorts/radix_sort.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sorts/radix_sort.py b/sorts/radix_sort.py index 82f8a38b4..29b51ad42 100644 --- a/sorts/radix_sort.py +++ b/sorts/radix_sort.py @@ -9,9 +9,9 @@ def radixsort(lst): buckets = [list() for _ in range( RADIX )] # split lst between lists - for i in lst: - tmp = i / placement - buckets[tmp % RADIX].append( i ) + for i in lst: + tmp = int((i / placement) % RADIX) + buckets[tmp].append(i) if maxLength and tmp > 0: maxLength = False