英语单词查询
bucketsort
「bucketsort」的意思
存储桶排序
null
「bucketsort」的用法
bucketsort桶排序 - 编程
「bucketsort」的例句
Bucket sort is a comparison sort algorithm.
桶排序是一种比较排序算法。
It works by distributing the input values into several buckets.
它通过将输入值分配到几个桶中来工作。
Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sort.
然后,每个桶单独进行排序,可以使用不同的排序算法,或者递归地应用桶排序。
Bucket sort is mainly useful when input is uniformly distributed over a range.
桶排序主要用于输入在某个范围内均匀分布的情况。
The worst-case time complexity of bucket sort is O(n^2).
桶排序的最坏情况时间复杂度是O(n^2)。
However, under certain conditions, it can perform much better.
然而,在某些条件下,它可以表现得非常好。
For example, if the input values are randomly distributed, bucket sort can perform in linear time, O(n).
例如,如果输入值是随机分布的,桶排序可以在线性时间内完成,O(n)。
Bucket sort can be implemented as an in-place sorting algorithm.
桶排序可以实现为就地排序算法。
This means that it requires only a small, constant amount of additional storage space.
这意味着它只需要很小的、常数数量的额外存储空间。
However, it does not guarantee that the input will be sorted after one pass through the buckets.
然而,它不能保证在一次遍历桶后输入就会被排序。