在dfs的时候用到了队列,可以使用LinkLedList容器,利用其中的addlast()进栈操作,removeFirst()进行出栈操作
static LinkedList<Integer> l=new LinkedList<Integer>();
l.addLast(i);
l.removeFirst();
在dfs的时候用到了队列,可以使用LinkLedList容器,利用其中的addlast()进栈操作,removeFirst()进行出栈操作
static LinkedList<Integer> l=new LinkedList<Integer>();
l.addLast(i);
l.removeFirst();

被折叠的 条评论
为什么被折叠?