摘要: 广度优先搜索 class Solution { // 定义一个方向数组 static int[][] directions = new int[][]{{0, 1}, {1, 0}, {-1, 0},{0, -1}}; // X,Y的上限 static int limit = (int)1e6; p 阅读全文
posted @ 2020-10-15 10:54 消灭猕猴桃 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 层次遍历 思路:按层遍历每一个节点,将每一层的节点相连接 /* // Definition for a Node. class Node { public int val; public Node left; public Node right; public Node next; public N 阅读全文
posted @ 2020-10-15 09:04 消灭猕猴桃 阅读(67) 评论(0) 推荐(0) 编辑