W4 - ARRAYS Flashcards

1
Q

W4-1: What is the SIMPLEST DATA STRUCTURE in the (C)?

A

is a list of VARIABLES of the SAME type
=> _ call such a list an ARRAY and the variables in that array its ELEMENTS.
_ refer to any ELEMENT by its INDEX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
#W4-2: (a) Definition of an ARRAY
(b) What is CONTIGUOUS STORAGE
A

(a) is a DATA STRUCTURE consisting of an ORDERED SET of ELEMENTS of COMMON TYPE that are STORED CONTIGUOUSLY IN MEMORY.
(b) is storage without any GAPS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
#W4-3: (a) PARALLEL ARRAYS
(b) Why the arrays are PARALLEL?
A

(a) _ A convenient way to store TABULAR INFO is through 2 PARALLEL ARRAYS.
_ One arrays holds the KEY, while the other hold VALUES.

(b) The arrays are PARALLEL b/c the ELEMENTS at the SAME index hold data that are related to the SAME ENTITY.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly