---
title: "Straight selection sort on 33, 90, 45, ..."
subject: "Data Structure and Algorithm"
chapter: 7
key: "semester_4/data_structure_and_algorithm:selection-sort-trace-33-90"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/selection-sort-trace-33-90
site: BCT Engineering
---

# Straight selection sort on 33, 90, 45, ...

Data Structure and Algorithm · Chapter 7: Sorting

- Asked in: 2068 Magh, 3 marks
- Video: [Selection sort example in data structure | in Hindi | Sorting types](https://www.youtube.com/watch?v=U0S4x2zx43g) — CS Engineering Gyan
- 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/selection-sort-trace-33-90
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-7

## Question

Trace the sorting steps in straight selection sort for the data: 33, 90, 45, 8, 52, 76, 5, 22.

## Short answer

Straight selection sort repeatedly finds the smallest unsorted element and swaps it into place. After 7 passes, the sorted list is 5, 8, 22, 33, 45, 52, 76, 90.

## Answer

In each pass, find the smallest element in the unsorted part and swap it with the first element of that part.

| Pass | Smallest | Swap | List after the pass |
|---|---|---|---|
| Start | | | 33, 90, 45, 8, 52, 76, 5, 22 |
| 1 | 5 | 33 ↔ 5 | 5, 90, 45, 8, 52, 76, 33, 22 |
| 2 | 8 | 90 ↔ 8 | 5, 8, 45, 90, 52, 76, 33, 22 |
| 3 | 22 | 45 ↔ 22 | 5, 8, 22, 90, 52, 76, 33, 45 |
| 4 | 33 | 90 ↔ 33 | 5, 8, 22, 33, 52, 76, 90, 45 |
| 5 | 45 | 52 ↔ 45 | 5, 8, 22, 33, 45, 76, 90, 52 |
| 6 | 52 | 76 ↔ 52 | 5, 8, 22, 33, 45, 52, 90, 76 |
| 7 | 76 | 90 ↔ 76 | 5, 8, 22, 33, 45, 52, 76, 90 |

**Answer: 5, 8, 22, 33, 45, 52, 76, 90** (7 passes for 8 elements)

## Check yourself

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

1. In pass 1 on 33, 90, 45, 8, 52, 76, 5, 22, what is swapped?
   A. 33 with 5
   B. 33 with 8
   C. 90 with 5
   D. 33 with 22
   Answer: A. 5 is the smallest and swaps with the first element. (Key point: Pass 1)

2. How many passes for 8 elements?
   A. 8
   B. 7
   C. 4
   D. 9
   Answer: B. n-1 passes. (Key point: Pass count)

3. In pass 3, which swap occurs?
   A. 45 with 22
   B. 90 with 22
   C. 45 with 33
   D. None
   Answer: A. 22 is the smallest of the unsorted part and goes to position 2. (Key point: Pass 3)

## Related in Data Structure and Algorithm

- [Selection sort with trace](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aselection-sort-explain-trace) — Data Structure and Algorithm, chapter 7
- [Efficiency of straight selection sort](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aselection-sort-efficiency) — 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
- [Merge sort algorithm and trace](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Amerge-sort-algorithm-trace) — Data Structure and Algorithm, chapter 7
- [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
- [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

## 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
- [Personnel management and selection steps](https://www.bctengineer.com/question.md?key=semester_8%2Fconstruction_management%3Apersonnel-management-selection-steps) — Construction Management, chapter 10, asked 3×
- [Total station features and data recording steps](https://www.bctengineer.com/question.md?key=semester_4%2Fsurveying_ii%3Atotal-station-features-data-recording) — Surveying II, chapter 9
- [22 pairs: means, consistency, correlation](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Asample-22-pairs-xy-correlation) — Probability and Statistics, chapter 5
