We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a4c084 commit 7e2ee23Copy full SHA for 7e2ee23
Python/sort/Bucket_sort.py
@@ -14,7 +14,7 @@ def bucket_sort(arr):
14
bucket_list = []
15
for i in enumerate(arr):
16
bucket_num = i[0]
17
- if bucket_num< len(arr):
+ if bucket_num < len(arr):
18
bucket_list.append([])
19
20
# numerical range of each bucket
@@ -62,11 +62,10 @@ def main():
62
63
# Sorted List
64
# 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
+# Time Complexity -
+# 1. Best case - O(n+k)
+# 2. Average case - O(n+k)
+# 3. Worst case - O(n^2)
+# where n = number of elements in the input array
70
71
-Space Complexity - O(nk)
72
-'''
+# Space Complexity - O(nk)
0 commit comments