Data Structures Visualizations

COSC 2306 - Chapter 6: Queues & Deques

Interactive Demonstrations

Select a topic below to launch the interactive visualizer. The order follows the COSC 2306 lecture materials.

Basic Queue (FIFO)

Visualize standard First-In, First-Out queue operations. Add elements to the rear with enqueue() and remove from the front with dequeue().

Launch Visualizer →

Moving Items in a Circle

Programming Assignment Visualizer: Shift elements in a list num times in a circle by rapidly dequeuing and enqueuing items.

Launch Visualizer →

Reverse First K Elements

Watch a step-by-step algorithm animation combining both a Stack and a Queue to reverse only the first K elements of a sequence while keeping the rest intact.

Launch Visualizer →

Deque Operations

Explore Double-Ended Queues. See how items can be added and removed from both ends in O(1) time using Python's collections.deque.

Launch Visualizer →

Deque Toggle: Stack vs Queue

Compare data structures by forcing a Deque to act as either a strict Stack (LIFO) or a strict Queue (FIFO) using mode toggles. Demonstrates queue vs stack implementation logic.

Launch Visualizer →