Skip to content

Commit 7e2ee23

Browse files
authored
Update Bucket_sort.py
1 parent 4a4c084 commit 7e2ee23

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Python/sort/Bucket_sort.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def bucket_sort(arr):
1414
bucket_list = []
1515
for i in enumerate(arr):
1616
bucket_num = i[0]
17-
if bucket_num< len(arr):
17+
if bucket_num < len(arr):
1818
bucket_list.append([])
1919

2020
# numerical range of each bucket
@@ -62,11 +62,10 @@ def main():
6262

6363
# Sorted List
6464
# 1.2 2.6 4.0 6.3 7.7 12.5
65-
''' Time Complexity -
66-
1. Best case - O(n+k)
67-
2. Average case - O(n+k)
68-
3. Worst case - O(n^2)
69-
where n = number of elements in the input array
65+
# Time Complexity -
66+
# 1. Best case - O(n+k)
67+
# 2. Average case - O(n+k)
68+
# 3. Worst case - O(n^2)
69+
# where n = number of elements in the input array
7070

71-
Space Complexity - O(nk)
72-
'''
71+
# Space Complexity - O(nk)

0 commit comments

Comments
 (0)