storing the dfs traversal in the array e
void dfs ( int src ) { e . pb ( src ) ; visited [ src ] = 1 ; for ( int i = 0 ; i < sz ( g [ src ] ) ; i ++ ) { int des = g [ src ] [ i ] ; if ( ! visited [ des ] ) { dfs ( des ) ; e . pb ( src ) ; } } }