CS 302 · Data Structures · University of Nevada, Reno

Nicole Beaulieu, Ph.D.

Current Courses

Course materials, interactive visualizations, and resources.

Spring 2026

CS 302 · Data Structures

Arrays, linked lists, stacks, queues, trees, sorting, searching, and algorithmic analysis. Emphasis on understanding through visualization and hands-on practice.

Walls & Mirrors · Ch. 1-19

CS 302 · Interactive Visualizations

Step-through animations. Play, pause, or advance one operation at a time.

Arrays

Access, insert, delete, and search. Watch elements shift during insert/delete operations.

O(1) access · O(n) insert/delete

Linked Lists

Singly and doubly linked. Insert, delete, search, and reverse with pointer animations.

O(1) head insert · O(n) access

Stacks

Dual array and linked-list views. Push, pop, peek, and a balanced parentheses checker.

O(1) all operations · LIFO

Queues

Circular array with wrap-around and linked-list views. Enqueue, dequeue, and peek.

O(1) all operations · FIFO

Recursion

Visual call stack and recursion tree. Factorial, Fibonacci, and binary search step-by-step.

Call stack · Memoization

Selection Sort

Find largest → swap to end. Sorted region grows right to left.

O(n²) all cases · O(n) moves

Bubble Sort

Adjacent swaps with boolean flag for early termination.

O(n²) worst · O(n) best

Insertion Sort

Save item, shift right, insert into gap. Shifts, not swaps.

O(n²) worst · O(n) best

Binary Search Trees

Insert, search, and compare balanced vs degenerate trees. See how shape drives performance.

O(log n) best · O(n) worst

Dictionary (Hash Table)

Add, search, and delete key-value pairs. See hashing, collisions, and four collision resolution strategies.

O(1) avg all operations

Max-Heap

Insert, extract max, and build heap. See both tree and array representations simultaneously.

O(log n) insert/extract · O(n) build

AVL Tree

Self-balancing BST. Insert values and watch LL, RR, LR, and RL rotations fire to keep |balance factor| ≤ 1.

O(log n) worst case · strict balance

Red-Black Tree

Self-balancing BST via node colors. Five properties, three fix-up cases, and the backing store of std::map.

O(log n) worst case · fewer rotations

2-3 Tree

Multi-way search tree with bottom-up node splits. Perfectly height-balanced. Direct ancestor of B-trees.

O(log n) · every leaf at same depth

2-3-4 Tree

Multi-way tree with top-down preemptive splitting. Single-pass insert. Isomorphic to red-black trees.

O(log n) · the key to red-black

CS 302 · Code Examples

Well-documented C++ implementations with step-by-step visualizations. Perfect for studying and reference.

Arrays (C++)

Access, insert, delete, search with shift animations. Fixed-capacity array operations.

O(1) access · O(n) insert/delete

Linked Lists (C++)

Singly and doubly linked list implementations with insert, delete, search, and reverse.

O(1) head insert · O(n) access

Stacks (C++)

Array-backed and linked-list-backed implementations with balanced parentheses checker.

O(1) push/pop · LIFO

Queues (C++)

Circular array queue with wrap-around and linked-list queue. Modular arithmetic explained.

O(1) enqueue/dequeue · FIFO

Recursion (C++)

Factorial, Fibonacci (naive and memoized), and recursive binary search with call tracing.

Call stack · Memoization

Selection Sort (C++)

Maximum-to-end variant. Comprehensive documentation, examples, and step-by-step visualization.

O(n²) all cases · O(n) moves

Bubble Sort (C++)

Adjacent swaps with early termination. Demonstrates O(n) best case with already-sorted data.

O(n²) worst · O(n) best

Insertion Sort (C++)

Uses shifts, not swaps. Excellent for nearly-sorted data. Shows O(n) best case efficiency.

O(n²) worst · O(n) best

Dictionary (C++)

Hash table with four collision strategies. Add, get, remove, rehashing, and word frequency demo.

O(1) avg all operations

Max-Heap (C++)

Insert, extract max, and build heap with sift up/down. Includes step-by-step visualizations.

O(log n) insert/extract · O(n) build

AVL Tree (C++)

Self-balancing BST with LL, RR, LR, RL rotations. Step-by-step trace of rebalances.

O(log n) worst case

Red-Black Tree (C++)

CLRS-style sentinel NIL implementation with insert + fix-up. Colored pretty-print.

O(log n) worst case

2-3 Tree (C++)

Multi-way tree with bottom-up split propagation. Perfect balance without rotations.

O(log n) · ancestor of B-trees

2-3-4 Tree (C++)

Multi-way tree with top-down preemptive splitting. Single-pass insert. Red-black twin.

O(log n) · single-pass insert

All Code Examples

Browse all C++ implementations in the code directory. Includes README with compilation instructions.

View on GitHub

CS 302 · Pseudocode

Algorithm pseudocode with step-by-step examples. Perfect for understanding concepts before implementation.

Arrays Pseudocode

Access, insert, delete, search operations with shift examples and complexity analysis.

O(1) access · O(n) insert/delete

Linked Lists Pseudocode

Singly and doubly linked operations with ASCII pointer diagrams and step-by-step examples.

O(1) head insert · O(n) access

Stacks Pseudocode

Array and linked-list implementations. Includes balanced parentheses checking algorithm.

O(1) push/pop · LIFO

Queues Pseudocode

Circular array with wrap-around examples and linked-list implementations.

O(1) enqueue/dequeue · FIFO

Recursion Pseudocode

Factorial, Fibonacci, binary search with ASCII call trees and memoization.

Call stack · Memoization

Selection Sort Pseudocode

Maximum-to-end variant. Includes algorithm, step-by-step example, and complexity analysis.

O(n²) all cases

Bubble Sort Pseudocode

With early termination. Shows adjacent pair comparison and bubbling effect with examples.

O(n²) worst · O(n) best

Insertion Sort Pseudocode

Uses shifts, not swaps. Demonstrates left-to-right growth and efficiency for nearly-sorted data.

O(n²) worst · O(n) best

Dictionary Pseudocode

Modular hashing, Horner's rule, add, get, remove, and rehash with step-by-step collision examples.

O(1) avg all operations

Max-Heap Pseudocode

Sift up, sift down, insert, extract max, and build heap. Array-based tree with index arithmetic.

O(log n) insert/extract · O(n) build

AVL Tree Pseudocode

Height-balanced BST with LL, RR, LR, RL rotations. Worked example of ascending inserts.

O(log n) worst case

Red-Black Tree Pseudocode

Five properties, CLRS-style insert + three fix-up cases with worked example.

O(log n) worst case

2-3 Tree Pseudocode

Bottom-up split propagation with worked example. Perfect balance without rotations.

O(log n) · ancestor of B-trees

2-3-4 Tree Pseudocode

Top-down preemptive split pseudocode. Single-pass insert; isomorphic to red-black trees.

O(log n) · single-pass insert

All Pseudocode

Browse all pseudocode files. Includes README with teaching guidance and notation guide.

View on GitHub