Intro to DSA Flashcards
what is a data structure?
a way of organizing, storing, and performing operations on data
record
ds that stores subitems. called fields, with a name associated with each subitem (typically found in databases)
array
ds stores an ordered list of items and is accessible by a positional index
linked list
- ds stores an ordered list of items in nodes
- each node stores data and has a pointer to next node
binary tree
ds where each node stores data and has up to two children (left and right child)
hash table
ds stores unordered items by mapping (or hashing) each item to a location in an array
max-heap
tree maintains simple property that node’s key is greater than or equal to node’s childrens’ keys
min-heap
tree maintains simple property that node’s key is less than or equal to node’s childrens’ keys
graph
ds for representing connections among items, and has vertices connected by edges
vertex in graph ds
represents an item in a graph
edge in graph ds
represents a connection between two vertices in a graph
algorithm
set of commands that must be followed for computer to perform calculations or solving a problem
characteristics of an algorithm
unambiguity, finiteness, well-defined inputs, well-defined outputs, effectiveness, feasibility, and language independence
abstract data type (adt)
data type described by predefined user operations
9 common ADTs
list, dynamic array, stack, queue, deque, bag, set, priority queue, dictionary (map)