What goes in the blank?
# store an undirected edge (u, v) graph[u].append(v) graph[____].append(u)
Answer: v
An undirected edge is recorded in both adjacency lists, so v must also point back to u.
Play Problem Solving ▸
# store an undirected edge (u, v) graph[u].append(v) graph[____].append(u)
Answer: v