Which of the following is an advantage of using arrays?

2024

Which of the following is an advantage of using arrays?

  1. A.

    Constant time insertion and deletion

  2. B.

    Ability to store elements of different data types

  3. C.

    Random access to elements using an index

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 1486 students.

Show answer & explanation

Correct answer: C

Step 1: Arrays allow random access to elements using an index, which means any element can be accessed directly in O(1) time using the formula: address = base_address + index * size_of_element. This is a key advantage of arrays. Step 2: Insertion and deletion in arrays are not constant time operations because elements need to be shifted to maintain contiguous memory. This makes Option A incorrect. Step 3: Arrays can only store elements of the same data type. They cannot store different data types in a single array. This makes Option B incorrect. Step 4: Since only Option C is correct, Option D (more than one) and Option E (none) are incorrect.

Explore the full course: Up Lt Grade Assistant Teacher 2025