MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these best describes an array?
A
A data structure that shows a hierarchical behavior
B
Container of objects of similar types
C
Arrays are immutable once initialized
D
Array is not a data structure
Explanation: 

Detailed explanation-1: -Answer: B. containera of objects of similar type. Array is a collection of same data item that shares the same name.

Detailed explanation-2: -The correct answer is (C) Container Of Objects Of Similar Types.

Detailed explanation-3: -An array is a collection of elements of the same type placed in contiguous memory locations that can be individually referenced by using an index to a unique identifier. Five values of type int can be declared as an array without having to declare five different variables (each with its own identifier).

Detailed explanation-4: -Also lists are containers for elements having differing data types but arrays are used as containers for elements of the same data type.

Detailed explanation-5: -Each variable or object in an array is called an element. Unlike stricter languages, such as Java, you can store a mixture of data types in a single array. For example, you could have array with the following four elements: an integer, a window object, a string and a button object.

There is 1 question to complete.