---
title: "Radix sort on 32, 45, 60, 83, ..."
subject: "Data Structure and Algorithm"
chapter: 7
key: "semester_4/data_structure_and_algorithm:radix-sort-32-45-60"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/radix-sort-32-45-60
site: BCT Engineering
---

# Radix sort on 32, 45, 60, 83, ...

Data Structure and Algorithm · Chapter 7: Sorting

- Asked in: 2070 Bhadra, 3+5 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/radix-sort-32-45-60
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-7

## Question

Explain radix sort. Sort the given data 32, 45, 60, 83, 75, 43, 70, and 69 using radix sort.

## Short answer

Radix sort sorts by digit position from least significant to most, distributing keys into ten queues per pass and collecting in order. Each pass is stable. For the given data, after two passes the sorted list is 32, 43, 45, 60, 69, 70, 75, 83.

## Answer

Radix sort sorts keys digit by digit from the least significant digit, distributing keys into ten queues (0 to 9) in each pass and collecting them in queue order. Each pass is stable, so after the pass for the most significant digit the list is sorted. Time is O(d·n) for *d*-digit keys.

#### Algorithm
```text
RADIXSORT(a, n)
1. d = number of digits of the largest key
2. for pass = 1 to d
3.     put each a[i] at rear of queue[ digit pass of a[i] ]
4.     collect queue 0, 1, ..., 9 back into a
```

#### Sorting 32, 45, 60, 83, 75, 43, 70, 69 (2 passes)
**Pass 1 (units digit)**

| Queue | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|---|
| Keys | 60, 70 | | 32 | 83, 43 | | 45, 75 | | | | 69 |

List: 60, 70, 32, 83, 43, 45, 75, 69

**Pass 2 (tens digit)**

| Queue | 0-2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|
| Keys | | 32 | 43, 45 | | 60, 69 | 70, 75 | 83 | |

**Answer: 32, 43, 45, 60, 69, 70, 75, 83**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How many passes are needed for 32, 45, 60, 83, 75, 43, 70, 69?
   A. 1
   B. 2
   C. 8
   D. 10
   Answer: B. The largest keys have 2 digits. (Key point: Passes)

2. Which queue holds 60 and 70 in the units pass?
   A. Queue 0
   B. Queue 6
   C. Queue 7
   D. Queue 9
   Answer: A. Both have units digit 0. (Key point: Pass 1 queue)

3. What is the list after the units pass?
   A. 60, 70, 32, 83, 43, 45, 75, 69
   B. 32, 43, 45, 60, 69, 70, 75, 83
   C. 45, 75, 60, 70, 32, 83, 43, 69
   D. 69, 45, 75, 83, 43, 32, 70, 60
   Answer: A. Collected in queue order 0 to 9. (Key point: Pass 1 result)

## Related in Data Structure and Algorithm

- [Shell sort on 92, 83, 22, 49, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Ashell-sort-trace) — Data Structure and Algorithm, chapter 7
- [Radix sort on 345, 654, 924, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aradix-sort-345-654) — Data Structure and Algorithm, chapter 7
- [Radix sort definition and algorithm](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aradix-sort-algorithm) — Data Structure and Algorithm, chapter 7
- [Merge and radix sort on 142, 523, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Amerge-radix-trace-142) — Data Structure and Algorithm, chapter 7
- [Radix sort on 25, 57, 48, 37, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aradix-sort-25-57-48) — Data Structure and Algorithm, chapter 7
- [Straight selection sort on 33, 90, 45, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aselection-sort-trace-33-90) — Data Structure and Algorithm, chapter 7

## Related in other subjects

- [Conductor selection, 100 MW 70 km 132 kV](https://www.bctengineer.com/question.md?key=semester_8%2Ftransmission_and_distribution_system_design%3Aconductor-selection-100mw-70km-132kv) — Transmission and Distribution System Design, chapter 4
- [Cable size MDB to SDB-1 (60 kW) and SDB-2 (75 kW)](https://www.bctengineer.com/question.md?key=semester_6%2Findustrial_power_distribution_and_illumination%3Acable-mdb-sdb-60kw-75kw) — Industrial Power Distribution and Illumination, chapter 5, asked 4×
- [Gumbel design flood, 43 years data, 85% reliability](https://www.bctengineer.com/question.md?key=semester_5%2Fengineering_hydrology%3Agumbel-43yr-330-187-life50) — Engineering Hydrology, chapter 6, asked 2×
- [Cutting volume, 60 m, GL 540.70, formation 538.20](https://www.bctengineer.com/question.md?key=semester_3%2Fsurveying_i%3Avolume-cutting-60m-gl-540-70) — Surveying I, chapter 9, asked 7×
