DFS Recursive Solution
Try implementing the recursive solution on your own. Keep in mind that we first need to process the vertex before visiting other vertices. This should help you with the solution.
Again, it's important to note that multiple outputs are valid depth-first searches using preorder traversal. With our source node of 2, we can process our three outgoing neighbors in any order, so long as we explore that neighbor's entire depth before going to the next neighbor. The two most likely outcomes, based on our adjacency list, would be to process first 1 and its path, then 3 and its path, then 4 and its path, or, as we did in the walkthrough above, first 4, then 3, then 1.