Algorithms / Data Structures Flashcards
Abstract data type (ADT)
A model of a data structure (properties, operations, etc); from the POV of its user
Algorithm
A finite set of well-defined instructions typically used to solve a particular class of problem; must have a sequence of operations, a control flow, and a stopping condition
Binary tree
A tree whose nodes have at most two children
Data structure
The implementation of an ADT (queue => array); from the POV of its programmer
Graph
A collection of nodes and their edges
Internal node
A node that has children
Leaf node
A node that does not have children
Linked list
A linear data structure; has head (first node), tail (last node) and length properties; its data is stored non-contiguously
Queue
A first-in-first-out, linear data structure
Linear data structure
A data structure whose nodes are ordered sequentially and each have references to their adjacent nodes; easier to implement but less memory efficient than nonlinear
Nonlinear data structure
A data structure whose nodes are ordered hierarchically; harder to implement but more memory efficient than linear
Stack
A last-in-first-out, linear data structure
Tree
A graph that doesn’t contain any cycles (loops back to a previous node); ‘rooted’ if it has a single root node