Describe how you would perform breadth-first search and depth-first search traversals on trees or graphs.
Write Python functions that return the traversal order for a connected tree or graph represented as an adjacency list. Assume nodes are hashable values, and the graph may be directed or undirected. Use iterative BFS and DFS, and visit neighbors in the order they appear in the adjacency list.
def traverse_graph(graph, start):