---
title: "Radix sort on 25, 57, 48, 37, ..."
subject: "Data Structure and Algorithm"
chapter: 7
key: "semester_4/data_structure_and_algorithm:radix-sort-25-57-48"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/radix-sort-25-57-48
site: BCT Engineering
---

# Radix sort on 25, 57, 48, 37, ...

Data Structure and Algorithm · Chapter 7: Sorting

- Asked in: 2069 Poush, 5 marks
- Video: [L-3.9: Radix Sort | Easiest explanation with example](https://www.youtube.com/watch?v=9QSgBO9yjKU) — Gate Smashers
- 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-25-57-48
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-7

## Question

Trace the sorting steps in radix sort for: 25, 57, 48, 37, 12, 92, 86, 33 showing status of all queues in each iterations.

## Short answer

Radix sort: two passes, distributing by units then tens into ten queues. Final sorted list: 12, 25, 33, 37, 48, 57, 86, 92.

## Answer

Radix sort uses 10 queues; the maximum key is 92 (2 digits), so 2 passes are needed.

**Initial list:** 25, 57, 48, 37, 12, 92, 86, 33

#### Pass 1 (units digit)
| Queue | Contents (front to rear) |
|---|---|
| 0 | empty |
| 1 | empty |
| 2 | 12, 92 |
| 3 | 33 |
| 4 | empty |
| 5 | 25 |
| 6 | 86 |
| 7 | 57, 37 |
| 8 | 48 |
| 9 | empty |

After collecting: 12, 92, 33, 25, 86, 57, 37, 48

#### Pass 2 (tens digit)
| Queue | Contents (front to rear) |
|---|---|
| 0 | empty |
| 1 | 12 |
| 2 | 25 |
| 3 | 33, 37 |
| 4 | 48 |
| 5 | 57 |
| 6, 7 | empty |
| 8 | 86 |
| 9 | 92 |

After collecting: 12, 25, 33, 37, 48, 57, 86, 92

**Answer: 12, 25, 33, 37, 48, 57, 86, 92**

## Check yourself

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

1. Why are 2 passes needed for 25, 57, 48, 37, 12, 92, 86, 33?
   A. There are 8 keys
   B. The maximum key 92 has 2 digits
   C. Two queues are used
   D. The base is 2
   Answer: B. Passes equal the digit count of the largest key. (Key point: Number of passes)

2. In the units pass, which keys are in queue 7?
   A. 57, 37
   B. 25
   C. 12, 92
   D. 86
   Answer: A. Both end in 7, in input order. (Key point: Pass 1 queue)

3. Why is 57 before 37 in queue 7?
   A. It is larger
   B. Keys keep the order they were inserted (stable, FIFO)
   C. Alphabetical
   D. Random
   Answer: B. Queues are FIFO. (Key point: Order within queue)

4. What is the list after pass 1?
   A. 12, 92, 33, 25, 86, 57, 37, 48
   B. 12, 25, 33, 37, 48, 57, 86, 92
   C. 25, 57, 48, 37, 12, 92, 86, 33
   D. 92, 12, 33, 25, 86, 37, 57, 48
   Answer: A. Collected queue 0 to 9. (Key point: Result)

## Related in Data Structure and Algorithm

- [Heap sort on 37, 33, 26, 92, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aheap-construct-12-element) — 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
- [Merge sort on 85, 76, 46, 92, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Amerge-sort-trace-85-76) — 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
- [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
- [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
