Skip to content

Commit c0033f9

Browse files
rafaelleruAnshulMalik
authored andcommitted
Use local insertion sort (solves #334) (#370)
1 parent 8d3665b commit c0033f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sorts/bucket_sort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This program will illustrate how to implement bucket sort algorithm
44

55
# Wikipedia says: Bucket sort, or bin sort, is a sorting algorithm that works by distributing the
6-
# elements of an array into a number of buckets. Each bucket is then sorted individually, either using
6+
# elements of an array into a number of buckets. Each bucket is then sorted individually, either using
77
# a different sorting algorithm, or by recursively applying the bucket sorting algorithm. It is a
88
# distribution sort, and is a cousin of radix sort in the most to least significant digit flavour.
99
# Bucket sort is a generalization of pigeonhole sort. Bucket sort can be implemented with comparisons
@@ -14,7 +14,7 @@
1414
# Best Case O(n); Average Case O(n); Worst Case O(n)
1515

1616
from __future__ import print_function
17-
from P26_InsertionSort import insertionSort
17+
from insertion_sort import insertion_sort
1818
import math
1919

2020
DEFAULT_BUCKET_SIZE = 5
@@ -46,7 +46,7 @@ def bucketSort(myList, bucketSize=DEFAULT_BUCKET_SIZE):
4646
# Sort buckets and place back into input array
4747
sortedArray = []
4848
for i in range(0, len(buckets)):
49-
insertionSort(buckets[i])
49+
insertion_sort(buckets[i])
5050
for j in range(0, len(buckets[i])):
5151
sortedArray.append(buckets[i][j])
5252

0 commit comments

Comments
 (0)