Given the array a = [10, 20, 30, 40, 50, 60] with 6 elements,
Given the array a = [10, 20, 30, 40, 50, 60] with 6 elements,
What will the array look like after inserting the value 45 at index 4?
Show answerHide answer
Correct answer: (A) [10, 20, 30, 40, 45, 50, 60]
Explanation
Inserting 45 at index 4 shifts 50 and 60 one place right, giving [10, 20, 30, 40, 45, 50, 60]. The other options contain 25, which was never in the array.