# 1 Pertemuan 22 Radix Sort Matakuliah: T0016/Algoritma dan Pemrograman Tahun: 2005 Versi: versi 2.

## Presentation on theme: "1 Pertemuan 22 Radix Sort Matakuliah: T0016/Algoritma dan Pemrograman Tahun: 2005 Versi: versi 2."— Presentation transcript:

1 Pertemuan 22 Radix Sort Matakuliah: T0016/Algoritma dan Pemrograman Tahun: 2005 Versi: versi 2

3 Outline Materi Pengenalan radix sort

4 Radix Sort Definition : A multiple pass distribution sort algorithm that distributes each item to a bucket according to part of the item's key beginning with the least significant part of the key. After each pass, items are collected from the buckets, keeping the items in order, then redistributed according to the next most significant part of the key.

5 Radix Sort Here is a simple example of the sort. Suppose the input keys are 34, 12, 42, 32, 44, 41, 34, 11, 32, and 23. Four buckets are appropriate. The first pass distributes them by the least significant digit. After the first pass we have the following, where each line is a bucket. 41 11 12 42 32 32 23 34 44 34 We collect these, keeping their relative order: 41 11 12 42 32 32 23 34 44 34. Now we distribute by the next most significant digit, in this case, the highest digit, and we get the following. 11 12 23 32 32 34 34 41 42 44 When we collect them, they are in order: 11 12 23 32 32 34 34 41 42 44.