DescriptionQ1010
Q1010FWASIC interview problem
Bubble sort in place
TechniquesSortingDynamic arrayIn place
DifficultyEasy
TopicArrays
LanguageSystemVerilog
Requirements3 checkpoints
01
Problem
Sort a dynamic array of integers in ascending order using bubble sort.
Example input and output
Use this case to check your interpretationInput
values = [5, 1, 4, 2]Output
[1, 2, 4, 5]Explanation
Adjacent out-of-order pairs are exchanged until a pass performs no swaps.
02
Requirements (3)
- Modify the input array in place.
- Stop early when a full pass performs no swaps.
- Handle empty and one-element arrays.
