mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Update Bucket Sort time complexity analysis (#918)
This commit is contained in:
parent
f2eb965604
commit
1dc9ec8fb2
@ -17,7 +17,12 @@
|
||||
# number of buckets.
|
||||
|
||||
# Time Complexity of Solution:
|
||||
# Best Case O(n); Average Case O(n); Worst Case O(n)
|
||||
# Worst case scenario occurs when all the elements are placed in a single bucket. The overall performance
|
||||
# would then be dominated by the algorithm used to sort each bucket. In this case, O(n log n), because of TimSort
|
||||
#
|
||||
# Average Case O(n + (n^2)/k + k), where k is the number of buckets
|
||||
#
|
||||
# If k = O(n), time complexity is O(n)
|
||||
|
||||
DEFAULT_BUCKET_SIZE = 5
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user