Depth-First search added. Excludes visited nodes from the stack to prevent infinite loops.