Computer scienceAlgorithms and Data StructuresAlgorithmsArray algorithmsSorting algorithms

Sorting algorithms

Bubble Sort states

Report a typo

Given an array of five numbers: [5,3,8,4,2][5, 3, 8, 4, 2]. Sort its steps in the correct order after each Bubble Sort pass. Ignore duplicates.

Put the items in the correct order
[5, 3, 8, 4, 2]
[2, 3, 4, 5, 8]
[3, 5, 4, 2, 8]
[3, 4, 2, 5, 8]
[3, 2, 4, 5, 8]
___

Create a free account to access the full topic