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]Solution
Correct Answer: A • Code Analysis: o min_idx initially holds the index of the current assumed minimum (which is i). o The inner loop (for j in range(i + 1, n)) iterates through the rest of the unsorted array. o The if condition needs to check if the element at the current index j is smaller than the element currently considered the minimum (at min_idx). If it is, then j becomes the new min_idx. • Explanation of Correct Answer (A): arr[j] < arr[min_idx] o This condition directly compares the value at the current index j with the value at the min_idx found so far. If arr[j] is indeed smaller, it means we've found a new minimum, and min_idx should be updated to j. This is the core logic for finding the minimum element.
In the following question, two columns are given, containing three phrases each. A phrase from the first column may or may not connect with a phrase fr...
(A)The Mission launche...