1/27
Vocabulary practice flashcards covering algorithms, trees, heaps, graphs, and shortest path concepts from the lecture notes.
Divide and conquer
An algorithmic approach that breaks a problem into smaller problems, solves them, and combines the results.
Quicksort
A sorting algorithm that uses a pivot to partition values.
Mergesort
A sorting algorithm that splits an array in half, sorts each half, and merges them.
Backtracking
An algorithmic technique where you try a solution, and if it fails, go back and try another.
STL Standard Template Library
reusable C++ containers, algorithms, and iterators.
Tree
A hierarchical structure of nodes connected by edges; a tree with n nodes has n−1 edges and no cycles.
BST Binary Search Tree:
a tree where smaller values go left and larger values go right.
BST Insertion
A procedure where you start at the root, compare values, go left if smaller or right if larger, and insert at an empty spot.
Tree traversal
Visiting every node in a tree in a specific order.
Preorder traversal
A tree traversal that visits nodes in the order Root-Left-Right.
Inorder traversal
A tree traversal that visits nodes in the order Left-Root-Right.
Postorder traversal
A tree traversal that visits nodes in the order Left-Right-Root.
BFS Breadth-First Search:
a traversal that visits level by level using a queue (FIFO).
DFS Depth-First Search:
a traversal that explores one branch as far as possible before backtracking using a stack (LIFO) or recursion.
Heap
A complete binary tree that follows a min-heap or max-heap property; used for priority queues.
Min-heap
A heap with the smallest value at the root.
Max-heap
A heap with the largest value at the root.
Heap insertion
Adding an element at the next open position and percolating up by swapping with the parent when necessary.
Heap deletion
Removing the root, moving the last element to the root, and percolating down.
Graph
A collection of vertices (nodes) connected by edges.
Adjacency matrix
A 2D array showing connections between vertices; 1 means an edge exists and 0 means no edge in an unweighted graph.
Greedy algorithm
An algorithm that makes the best local choice at each step, hoping to find the overall best solution.
Graph coloring
Assigning colors to vertices so adjacent vertices have different colors, aiming to use the fewest colors possible.
Chromatic number
The minimum number of colors possible needed to color a graph.
Dynamic programming
Breaking problems into overlapping smaller problems and storing answers to avoid repeating work.
Shortest path problem
Finding the path with the smallest total cost or distance between vertices.
Dijkstra's Algorithm
A greedy algorithm that finds shortest paths from one starting vertex using nonnegative edge weights.
Relaxation
Updating a vertex's distance when a shorter path is found.