Multiple choice technology architecture

Which of the following data structure store the homogeneous data elements?

  1. Arrays

  2. Records

  3. Pointers

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Records are designed to store heterogeneous data elements - fields can be of different types (e.g., name:string, age:integer, salary:decimal). Arrays require homogeneous elements. Pointers store addresses. Therefore Records is the correct answer.

AI explanation

To answer this question, you need to understand the concept of data structures and the types of data they can store.

Option A) Arrays - Arrays are a data structure that can store a collection of elements of the same data type. Therefore, arrays can store homogeneous data elements. This option is correct.

Option B) Records - Records are a data structure that can store a collection of different data types. They can store both homogeneous and heterogeneous data elements. This option is correct.

Option C) Pointers - Pointers are not a data structure but rather a concept in programming. They store memory addresses of other data elements. Pointers themselves do not store homogeneous data elements.

Option D) None - This option is incorrect because both arrays and records can store homogeneous data elements.

The correct answer is B) Records. This option is correct because records can store homogeneous data elements as well as heterogeneous data elements.