Skip to main content
Loading page…
Python Mastery
Chapter 24
Lesson 3 of 5
Trees, Heaps & Graphs
Contents
Notes
Tutor
Concept
Binary Trees: Structure & Traversals
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
30 min
9 activities
0 of 9 done
In this lesson
1
Binary Trees: Structure & Traversals
2
Heaps & Priority Queues with heapq
3
Graphs: Representation & Traversal
4
How Python dict & set Use Hashing
5
BFS Shortest Path
6
K Largest Elements with heapq
7
Tree Traversal Orders
8
Heaps & Hash Tables: Concept Check
9
Gotcha: Mutable Default Arguments in Tree/Graph Functions
Objectives
Traverse a binary tree using in-order, pre-order, and post-order traversal
Use heapq to implement a min-heap and a priority queue
Represent a graph as an adjacency dictionary
Implement BFS and DFS on a graph
Explain how Python dict and set use hashing and why average lookups are O(1)
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: Stacks, Queues & Linked Lists
Next: Sorting & Searching