Question 103Asked in BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an advantage of using arrays?
AConstant time insertion and deletion
BAbility to store elements of different data types
CRandom access to elements using an index
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Random access to elements using an index
Explanation
Array elements sit in contiguous memory, so any element can be accessed directly by its index in O(1). Insertion and deletion cost O(n), and the elements must all be the same type.
From BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper