private void dfs(Digraph<?> G, Object v) {

        this.marked.put(v, true);

        for (Object temp : G.getAdjacentVertices(v)) {
            if (!marked.get(temp)) {
                dfs(G, temp);
            }
        }
        reversePost.push(v);
    }