Question: Which XXX would complete the following Python insertion sort algorithm? def insertion _ sort ( num _ list ) : for i in range (

Which XXX would complete the following Python insertion sort algorithm?
def insertion_sort(num_list): for i in range(1, len(num_list)): j = i XXX: temp = num_list[j] num_list[j]= num_list[j -1] num_list[j -1]= temp j -=1
a) while j <0 and num_list[j]> num_list[j -1]
b) while j >0 and num_list[j]< num_list[j -1]
c) while num_list[j]< num_list[j -1] and j >0
d) while j > i and num_list[j]< num_list[i]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!