Graph Theory &
Network Topology
Comprehensive study guides and community notes for the CS101 Advanced Data Structures course. Updated weekly by the study leads.
Key Concepts: BFS vs DFS
In Graph Theory, traversing nodes efficiently is crucial. We focused on two primary methods this week:
Breadth-First Search
- Uses a Queue (FIFO)
- Explores neighbors first
- Guarantees shortest path in unweighted graphs
Depth-First Search
- Uses a Stack (LIFO) or Recursion
- Explores as far as possible along branches
- Useful for topological sorting
Example Implementation (Python)
def bfs(graph, start_node):
visited = set()
queue = [start_node]
while queue:
vertex = queue.pop(0)
if vertex not in visited:
print(vertex)
visited.add(vertex)
queue.extend(graph[vertex] - visited)
Study Guides
Downloadable PDFs and interactive quizzes.
Complexity Analysis Cheat Sheet
A visual guide to Big O notation for common algorithms and data structures.
Download Now
Recursive Backtracking Lab
Walkthrough of the N-Queens problem and solving Sudoku using recursion.
Watch Lecture