i would like to check myself whether following procedures for DFS -Depth First search is correct( so i would like to check if i understood it correctly)
we have following Graph

we use stack for DFS, so let start : initially vertex A is added to the stack and it is marked as visited(first output is A), next adjacent element are (B,C,D), first let add B, because B has no any adjacent element pop B(so we have A B), now next visiting element of A is C, we push C on stack and C will be also output (A B C), C has only non visited element K, so add k to the stack and write on output (A B C K), K we has following non visited elements D and and L, push D(A B C K D), but D has no non visited adjacent vertex , so pop from stack , and push L, (A B C K D L), now L has only J so push J ( A B C K D L J) and J has only M so finally we have A B C K D L J M
am i right?thanks in advance
Not sure what you said but in case you chose to discover L from node K that is incorrect. You go to node K from node D. So basically the DFS graph has the following arcs:(A,B), (A,C), (C,K), (K,D),(D,L), (L,J), (J,M).