Data Structures and Algorithms Lecture Review

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/27

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering algorithms, trees, heaps, graphs, and shortest path concepts from the lecture notes.

28 Terms

1
New cards

Divide and conquer

An algorithmic approach that breaks a problem into smaller problems, solves them, and combines the results.

2
New cards

Quicksort

A sorting algorithm that uses a pivot to partition values.

3
New cards

Mergesort

A sorting algorithm that splits an array in half, sorts each half, and merges them.

4
New cards

Backtracking

An algorithmic technique where you try a solution, and if it fails, go back and try another.

5
New cards

STL Standard Template Library

reusable C++ containers, algorithms, and iterators.

6
New cards

Tree

A hierarchical structure of nodes connected by edges; a tree with nn nodes has n−1n - 1 edges and no cycles.

7
New cards

BST Binary Search Tree:

a tree where smaller values go left and larger values go right.

8
New cards

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.

9
New cards

Tree traversal

Visiting every node in a tree in a specific order.

10
New cards

Preorder traversal

A tree traversal that visits nodes in the order Root-Left-Right.

11
New cards

Inorder traversal

A tree traversal that visits nodes in the order Left-Root-Right.

12
New cards

Postorder traversal

A tree traversal that visits nodes in the order Left-Right-Root.

13
New cards

BFS Breadth-First Search:

a traversal that visits level by level using a queue (FIFO).

14
New cards

DFS Depth-First Search:

a traversal that explores one branch as far as possible before backtracking using a stack (LIFO) or recursion.

15
New cards

Heap

A complete binary tree that follows a min-heap or max-heap property; used for priority queues.

16
New cards

Min-heap

A heap with the smallest value at the root.

17
New cards

Max-heap

A heap with the largest value at the root.

18
New cards

Heap insertion

Adding an element at the next open position and percolating up by swapping with the parent when necessary.

19
New cards

Heap deletion

Removing the root, moving the last element to the root, and percolating down.

20
New cards

Graph

A collection of vertices (nodes) connected by edges.

21
New cards

Adjacency matrix

A 2D array showing connections between vertices; 11 means an edge exists and 00 means no edge in an unweighted graph.

22
New cards

Greedy algorithm

An algorithm that makes the best local choice at each step, hoping to find the overall best solution.

23
New cards

Graph coloring

Assigning colors to vertices so adjacent vertices have different colors, aiming to use the fewest colors possible.

24
New cards

Chromatic number

The minimum number of colors possible needed to color a graph.

25
New cards

Dynamic programming

Breaking problems into overlapping smaller problems and storing answers to avoid repeating work.

26
New cards

Shortest path problem

Finding the path with the smallest total cost or distance between vertices.

27
New cards

Dijkstra's Algorithm

A greedy algorithm that finds shortest paths from one starting vertex using nonnegative edge weights.

28
New cards

Relaxation

Updating a vertex's distance when a shorter path is found.