Question 42Asked in DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

Suppose there are n elements in an array A[ ]. If we want to insert a new element at position i in array A[ ], 1 ≤ i ≤ n, causing elements numbered i, i+1,…

Suppose there are n elements in an array A[ ]. If we want to insert a new element at position i in array A[ ], 1 ≤ i ≤ n, causing elements numbered i, i+1, …, n to become numbered:
  1. Ai−1, i, i+1, i+2, i+3, …, n+1
  2. Bi+1, i+2, i+3, …, n+1
  3. Ci−1, i+1, i+2, i+3, …, n+1
  4. Di+2, i+3, …, n+1
Show answerHide answer

Correct answer: (B) i+1, i+2, i+3, …, n+1

Explanation

To insert at position i, elements i to n each move one place to the right, so they become i+1, i+2, ..., n+1.

From DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

This is question 42 of DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.