Bucket sorting, counting order of ranking base

These three sorting algorithm is not based on the sort of comparison. The time complexity of O (N), the additional space complexity O (N), stable

Based on the frequency of the tub, to a data appears, a carrot a pit, first thrown into the bucket, the bucket according to the size of the pouring element.

 

Not based on the sort of comparison

The number n, n + 1 to prepare buckets. B a maximum value and a minimum value, the minimum number in a bucket, the bucket b on the maximum value. The range of each bucket (ba) / (n + 1).

 

Two barrels from the same barrel or adjacent neighbor. The maximum difference between the two numbers, not necessarily from the same barrel. A maximum value before the tub after a minimum.

Each bucket has

Are there elements of boolean bucket

min minimum tub

max maximum bucket

Before a non-empty barrel of their maximum minus the minimum.

Certainly not from the same barrel.

 

Guess you like

Origin www.cnblogs.com/bowenqianngzhibushiwo/p/11620746.html