Data Structures Flashcards
Key features of a list?
- dynamic
- items can be changed and replaced (mutable)
- can store more than one data type
- ordered collection of items
Key features of an array?
- static
- items can be changed or replaced (mutable)
- can only store one data type
- ordered collection of items
Key features of a tuple?
- static
- items cannot be changed or replaced (immutable)
- can store more than one data type
- unordered collection of items
What is a record?
A collection of different types of variables about one item
What is a linked list?
A static array containing both data and a pointer to the next item in the array. This means that list items can be stored anywhere in memory
What operations can be done on a linked list?
Add, delete, next(node), previous(node), traverse(through every item in the list)
What is a graph?
A set of vertices (nodes that have a value) and edges (links between nodes that can have values, and can either be directed or undirected)
What operations can be done on a graph?
Main ones are add, remove, add edge, remove edge, depth first search, breadth first search, pre order traversal, in order traversal, post order traversal
What is a tree?
A root node connected to other pointers with edges that are the root node’s descendants
What is a binary tree?
A special case of a tree where each nod has less than or equal to 2 descendants
What operations can be done on a tree?
Add, delete, binary search, pre, post and in order traversal, breadth first search, depth first search