Skip to main content
Loading page…
Python Mastery
Chapter 24
Lesson 2 of 5
Stacks, Queues & Linked Lists
Contents
Notes
Tutor
Concept
Linear Data Structures: The Mental Model
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
30 min
9 activities
0 of 9 done
In this lesson
1
Linear Data Structures: The Mental Model
2
Stack: Call Stack Simulation
3
Queue with collections.deque
4
Balanced Brackets Checker (Stack)
5
Singly Linked List: Theory & Implementation
6
Reverse a Linked List In-Place
7
Match Structure to Use Case
8
Gotcha: Never Use list as a Queue
9
Categorize Operations by Complexity
Objectives
Implement a stack using a Python list and explain its O(1) push/pop
Implement a queue using collections.deque and explain why list.pop(0) is wrong
Implement a singly linked list with insert, delete, and traversal
Choose the right linear structure for a given problem
Use deque as both a stack and a queue
Chapter 24 · Data Structures & Algorithms in Python
Big-O & Python Operation Costs
Stacks, Queues & Linked Lists
Trees, Heaps & Graphs
Sorting & Searching
Recursion, Backtracking & Dynamic Programming
Previous: Big-O & Python Operation Costs
Next: Trees, Heaps & Graphs