Solveeit Logo

Question

Computer Science Question on Sorting

Consider the following number list [8, 7, 13, 1, -9, 4] After applying selection sort, which of the list is correct after Pass 3 ?

A

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

B

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

C

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

D

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

Answer

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

Explanation

Solution

The correct option is (B) : [-9, 1, 4, 13, 8, 7]