Solved

What Should the Missing Code Be in the Following Insertion

Question 27

Multiple Choice

What should the missing code be in the following insertion sort algorithm? i = 1
While i < len(myList) :
ItemToInsert = myList[i]
J = i - 1
While j >= 0:
If itemToInsert < myList[j]:
MyList[j + 1] = myList[j]
J -= 1
Else:
Break
< missing code >
I += 1


A) myList[ i + 1 ] = itemToInsert
B) myList[ j ] = itemToInsert
C) myList[ j + 1 ] = itemToInsert
D) myList[ i ] = itemToInsert

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions