Explain how you would approach a problem that requires graph traversals or tree-based search structures.