Data Structures Flashcards

(18 cards)

1
Q

What determines the values a variable can store and the operations that can be performed on it?

A

The variable’s data type.

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

What is an integer an example of?

A

A primitive data type.

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

What are the primitive data types?

A

Int, Real (fractional numbers), Boolean (true/false), character, and string.

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

Is a string considered a primitive data type?

A

Yes, although it’s a collection of characters, it’s usually classified as a primitive data type.

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

What is a composite or compound data type?

A

A data type built by combining primitive data types.

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

What is a data structure?

A

A collection of data that is organised to allow efficient processing.

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

What is an abstract data type?

A

A conceptual model that describes how data is organised and what operations can be performed.

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

What is a static data structure?

A

A structure that reserves memory for a fixed amount of data.

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

Can the size of a static array be changed?

A

No, a new array must be created and data copied.

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

What is an advantage of static arrays?

A

Efficient direct access by index.

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

What is a disadvantage of static arrays?

A

Inefficient memory use if size is overestimated.

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

What is a dynamic data structure?

A

A structure with memory capacity that is not fixed.

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

What is an advantage of a linked list?

A

Size is not predetermined.

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

What is a disadvantage of a linked list?

A

Elements cannot be accessed directly.

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

Why do programmers use libraries for data structures?

A

To use well-tested and documented code.

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

Where is memory for dynamic structures like linked lists taken from?

A

From a memory heap.

17
Q

Do high-level languages manage heap memory automatically?

A

Yes, for example in Python.

18
Q

Do low-level languages manage heap memory automatically?

A

No, you must manage it manually in languages like C.