Tech_Interview_Prep

Graphs

Nodes and edges generalizing trees to arbitrary connections — cycles, multiple parents, and disconnected components all allowed.

Q1.What data structure is most commonly used to represent a sparse graph efficiently?

Q2.What does BFS (Breadth-First Search) on an unweighted graph guarantee?

Q3.What data structure does BFS use to control traversal order, and what does DFS typically use?

Q4.Why do graph traversals need to track visited nodes?