Depth-First Search(DFS): DFS is a graph algorithm that is able to visit every node and every edge given a starting node. With that being said, the time complexity of using DFS to traverse the entire graph is O(|V| + |E|) where V is the number of nodes and E is the number of edges.
Pseudocode:
def DFS(n):
mark n as visited
for each edge of n:
if edge->to_node is not visited: DFS(to_node)
Input Explanations:
1. starting node: The starting node to begin the traversal
2. ending node: This is an optional input. If this is specified DFS will try to find a path between the starting node and ending node