Assuming there are n keys and each key is in the range [0, m – 1]. The run time of bucket sort is
A. O(n)
B. O(n lgn)
C. O(n lgm)
D. O(n + m)
Answer:D
Assuming there are n keys and each key is in the range [0, m – 1]. The run time of bucket sort is
A. O(n) B. O(n lgn) C. O(n lgm) D. O(n + m)