5. Data Structures Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a data structure?

A

A data structure is a data organization, management, and storage format that is usually chosen for efficient access to data.

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

What is a Static Data Structure

A

SDS is a fixed-size data structure that doesn’t change in size during program execution. It has a predetermined maximum capacity which cannot be altered once set.

Examples: Arrays

+ Faster access time as its fixed
+ Predictable memory usage
- memory utilization may be inefficient

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

What is a Dynamic Data Structure?

A

A DDS is a flexible data structure that can change in size during program execution. It allows elements to be added or removed as needed.

+ Flexibility (well suited for situations where size of data is not known in advance or is likely to change)
+ Reduced memory waste

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

Characteristics of an Array, Record and a List

A

Array:
- An array is a data structure that holds elements of the same data type
- each position is identified by an index which allows for efficient access
- may result in wasted memory if not fully utilized
- fixed size that once set cannot be altered

Record:
- modelling complex entities with multiple attributes
- access elements by refencing a specific key or field name
- store elements of different data types

List:
- store elements of different data types
- can change in size dynamically during execution
- each position is identified by an index which allows for efficient access

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