Question discussion

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?

358847Medium DSSSB TGT Computer Science 0 replies 0 views
0
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?
  • A[10, 20, 30, 40, 45, 50, 60]
  • B[10, 20, 25, 30, 40, 45, 50]
  • C[10, 20, 25, 30, 40, 45, 60]
  • D[10, 25, 20, 30, 40, 45, 50]
Correct answer: A

Explanation

Inserting 45 at index 4 (the fifth place) shifts 50 and 60 to the right, giving [10, 20, 30, 40, 45, 50, 60].

Discussion 0

Nobody has replied yet. Start the discussion!