logo

Crowdly

Browser

Add to Chrome

Recall selection sort: SelectionSort(a[0..n-1]) i ← 0 WHILE i < n-1 ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Recall selection sort:

SelectionSort(a[0..n-1])

i ← 0

WHILE i < n-1

        min ← i

        j ← i+1

        WHILE j < n

                IF a[j] < a[min]

                        min ← j

                j = j + 1

        swap the elements of a at positions i and min

        i ← i + 1

 

Consider a selection sort of the following array:

 

01234567891011
LEXICOGRAPHY

 

What is the state of the array at the end of the third iteration of the outer loop?

 

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle4.city.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome