public static void dfs2(UndirectedGraphNode node){
        if(node == null) return;

        Stack<UndirectedGraphNode> stack = new Stack<UndirectedGraphNode>();
        stack.push(node);
        node.visited = true;
        System.out.print(node.label + " ");

        while(!stack.isEmpty()){
            UndirectedGraphNode n = stack.peek();
            UndirectedGraphNode child = getUnvisitedChildNode(n);
            if(child != null){
                child.visited = true;
                System.out.print(child.label + " ");
                stack.push(child);
            }else{
                stack.pop();
            }
        }
    }