This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Bucket sort (of type List[int]) | |
| """ | |
| from itertools import chain | |
| from typing import List | |
| def bucket_sort(somelist: List[int], n_buckets: int = None, approximate: bool = False): | |
| if n_buckets is None: | |
| n_buckets = int(len(somelist) ** 0.5) |
OlderNewer