140 likes | 294 Views
Chapter 9 Sorting part2 Sorting in linear time. Bernard Chen Spring 2006. Counting Sort. Assumes that each of the input elements is an integer in the range 0 to K The basic idea of counting sort is to determine, for each input element x, the number of elements less than x. Counting Sort.
E N D
Chapter 9 Sorting part2Sorting in linear time Bernard Chen Spring 2006
Counting Sort • Assumes that each of the input elements is an integer in the range 0 to K • The basic idea of counting sort is to determine, for each input element x, the number of elements less than x.
Radix Sort | | | • 329 720 720 329 • 457 355 329 355 • 657 436 436 436 • 839 457 839 457 • 436 657 355 657 • 720 329 457 720 • 355 839 657 839