All Courses

Data Structures

CS112  —  Data Structures
Professor Chris Rosa
Professor Chris Rosa
CS112  ·  Sacred Heart University
Course Description  ·  Undergraduate Catalog

A continuation of CS 111 using Python to implement multidimensional arrays, stacks, queues, linked lists, and binary trees. Also introduces recursion, pointers, and classes.

3 Credits
Prereq: CS-111
Python
Powered by Claude  ·  answers scoped to CS112 topics  ·  recommends tools when relevant
Data Structures & Concepts
Arrays & Algorithms — Coming Soon
Explore array indexing, traversal, multidimensional structures, and common array-based algorithms.
Indexing Traversal Multidimensional Arrays Search Algorithms
Linked Lists, Queues & Stacks — Coming Soon
Explore node-based collections and restricted-access structures, including linked-list traversal, queue operations, stack operations, and common implementation patterns.
Linked Lists Nodes Traversal Queues Stacks FIFO LIFO Deques
Insertion
BST Insert

Animate a single key insertion into a BST — trace the comparison path and watch the new node land in the correct position.

Step-by-step comparison at each node
Visual path trace root to insertion point
Highlights left/right decision at each level
Tree Shape
Insert Order Effect

Same 7 values, three different insertion orders. See how order determines tree height and balance — from perfectly balanced to fully degenerate.

Side-by-side balanced vs skewed comparison
Animated sequential insertion
Height and balance badge per tree
Search
BST Search

Interactive BST search — enter a value and watch the algorithm traverse the tree, highlighting comparisons and the search path in real time.

Animated node-by-node comparison
Highlights search path
Shows found / not found outcome
Deletion · Cases 1 & 2
BST Delete (Simple)

Covers BST deletion for leaf nodes and nodes with one child — the two simpler cases before introducing successor-based deletion.

Case 1: leaf node removal
Case 2: single-child node removal
Step-by-step animated tree restructure
Deletion · Case 3
BST Delete (Two Children)

The hardest deletion case — node with two children. Demonstrates finding the in-order successor, copying its value, and unlinking it from the right subtree.

In-order successor search animated
Value copy and successor unlink
BST property verified after deletion
Correctness
BST Violations

A deliberately broken BST with three violations. Step through each one — too many children, wrong subtree placement — and watch them get fixed.

Three distinct violations highlighted
Animated node repositioning to fix each
BST rule reminder panel
In / Pre / Post-order
Tree Traversals

Animate all three DFS traversal orders on the same tree. Switch between tabs and watch the visit sequence change with the order.

In-order, pre-order, post-order tabs
Live visit log with animated chips
Auto-play and step-by-step modes
BFS with Deque
Level-Order Traversal

Visualizes breadth-first level-order traversal using a deque, with side-by-side Python code showing how the algorithm maps to the animation.

BFS queue state shown at each step
Python code synchronized with animation
Level-by-level node visit order
Self-Balancing Trees
AVL Rotations

Explore all four AVL rotation types — LL, RR, LR, RL. Each shows the imbalance condition, the rotation steps, and the resulting balanced tree.

All four rotation cases (LL/RR/LR/RL)
Before and after tree comparison
Balance factor tracking per node
CS112 Assistant