Data Structures Flashcards
Define primitive data type
Can only contain only one value
Examples of primitive data type
Integer
Real (fractions)
Boolean
Character
Define compound data type
Combination of primitive data types
record
Define data structure
Collection of data that is organised to allow efficient processing
Define abstract data type
conceptual model that describes how data is organised
Define static data structures
reserves memory for a set amount of data
Advantages of static data structures
being able to access element directly (by index)
Easier to program, no need to check data structure size at any point
Disadvantages of static data structures
Inefficient memory use (if not full)
Can crash if not enough space is allocated
Define dynamic data structures
number of data items constrained only to the overall memory allocation of the program
(linked list)
Advantages of dynamic data structures
Memory capacity is not fixed.
Only necessary memory is used.
Disadvantages of dynamic structures
elements cannot be readily accessed directly.
harder to program, need to keep track of its size and data item locations.
Define memory heap
large pool of memory from which the running program can request chunks (linked list is taken from it)
Define array
holds collection of values of the same data type