Question

In a Selection Sort algorithm, the inner loop finds the index of the minimum element in the unsorted part. Which line correctly completes the if condition to update min_idx? def selection_sort(arr):     n = len(arr)     for i in range(n - 1):         min_idx = i         for j in range(i + 1,
n):             if __________: # Line to complete                 min_idx = j         arr[i], arr[min_idx] = arr[min_idx], arr[i]

A arr[j] < arr[min_idx]
B arr[j] > arr[min_idx]
C j < min_idx
D arr[j] == arr[min_idx]
E arr[i] < arr[j]
Practice Next

Hey! Ask a query