4.2 Data Structures Flashcards
What is an array?
A data structure that consists of an ordered, finite set of elements of a single data type.
What are 3 properties of arrays?
Data is stored contiguously in memory for efficient access
mutable - content can be changed
static - size can’t be changed after the array is declared
What is a record?
A collection of related attributes/fields under a single identifier.
What is a property of records?
mutable - the content can be changed
What is a list?
A data structure that consists of an ordered, finite set of elements of any data type.
What are 2 properties of lists?
dynamic - size can be changed after declaration
mutable - content can be changed
What is a tuple?
An immutable, static data structure used to store an ordered, finite set of elements of any data type.
What is a linked list?
An abstract data structure that consists of nodes that each contain data and a pointer that is the address of the next node in the list.
What are the 3 pointers?
null pointer for end of list
start pointer to first node in list
next free pointer to next available node in list
What is a graph?
An abstract data structure comprising of nodes and edges. Edges can have weights (costs) and directions and connect nodes together.
What is a stack?
An abstract static data structure where the last item in is the first item out.
What pointer do you need for a stack?
A pointer to the top item in the stack.
What is a queue?
An abstract data structure where the first item in is the first item out.
What pointers do you need for a queue?
a front and rear pointer
What is a tree?
A hierarchical abstract data structure with a root node and child nodes and branches that connect parent nodes to child nodes.