algorithm - Bucket sort---why's the input range important? -
i'm doing algorithms course @ uni, , read following sentence on introduction algorithms 3ed, p200:
...bucket sort fast because assumes input. whereas counting sort assumes input consists of integers in small range, bucket sort assumes input generated random process distributes elements uniformly , independently on interval [0,1)
why input has in [0,1)? why can't uniformly distributed sequence sorted using bucket sort?
i imagine interval [0, 1) used in order obtain theoretical result. notice, interval can converted given interval there no loss of generality. is, in practice uniformly distributed sequence can sorted using bucket sort.
Comments
Post a Comment