input: Write a python function to perform depth-first search (DFS) on a graph and return the list of visited nodes.
  assert dfs({'A': ['B', 'C'], 'B': ['D', 'E'], 'C': ['F'], 'D': [], 'E': ['F'], 'F': []}, 'A', []) == ['A', 'B', 'D', 'E', 'F', 'C']
  assert dfs({'1': ['2', '3'], '2': ['4', '5'], '3': [], '4': [], '5': []}, '1', []) == ['1', '2', '4', '5', '3']
  assert dfs({'X': ['Y', 'Z'], 'Y': ['Z'], 'Z': []}, 'X', []) == ['X', 'Y', 'Z']
output: def dfs(graph, start, visited):
      if start not in visited:
          visited.append(start)
          for neighbor in graph[start]:
              dfs(graph, neighbor, visited)
      return visited