摘要:
广度优先搜索 class Solution { // 定义一个方向数组 static int[][] directions = new int[][]{{0, 1}, {1, 0}, {-1, 0},{0, -1}}; // X,Y的上限 static int limit = (int)1e6; p 阅读全文
摘要:
层次遍历 思路:按层遍历每一个节点,将每一层的节点相连接 /* // Definition for a Node. class Node { public int val; public Node left; public Node right; public Node next; public N 阅读全文