Solveeit Logo

Question

Computer Science Question on Sorting

Consider a list [8, 7, 13, 1, -5, 4]
After 3rd pass of Bubble Sort, we get

A

[1, -5, 4, 7, 8, 13]

B

[1, -5, 7, 4, 8, 13]

C

[1, 7, -5, 4, 8, 13]

D

[7, 1, -5, 4, 8, 13]

Answer

[1, -5, 4, 7, 8, 13]

Explanation

Solution

The correct option is (A) :[1, -5, 4, 7, 8, 13].