摘要: import java.util.LinkedList; import java.util.Queue; import java.util.Stack; /** * 二叉树的序列化和反序列化 */ public class SerializationTree { public static void 阅读全文
posted @ 2021-10-19 23:30 code-G 阅读(38) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.HashSet; /** * 两个节点的公共最低祖先 */ public class CommonAncestor { public static void main(String[] args) { Binary 阅读全文
posted @ 2021-10-19 23:29 code-G 阅读(25) 评论(0) 推荐(0) 编辑
摘要: /** * 判定平衡二叉树 */ public class BalanceBinaryTree { public static void main(String[] args) { BinaryTreeNode node1 = new BinaryTreeNode(1); BinaryTreeNod 阅读全文
posted @ 2021-10-19 23:25 code-G 阅读(22) 评论(0) 推荐(0) 编辑
摘要: /** * 满二叉树的判定 */ public class FullBinaryTree { public static void main(String[] args) { BinaryTreeNode node1 = new BinaryTreeNode(1); BinaryTreeNode n 阅读全文
posted @ 2021-10-19 23:24 code-G 阅读(51) 评论(0) 推荐(0) 编辑
摘要: import java.util.LinkedList; import java.util.Queue; /** * 判断一个二叉树是不是完全二叉树 */ public class CompleteBinaryTree { public static void main(String[] args) 阅读全文
posted @ 2021-10-19 23:22 code-G 阅读(123) 评论(0) 推荐(0) 编辑
摘要: /** * 判断一个二叉树是否为搜索二叉树 */ public class SearchBinaryTree { public static void main(String[] args) { BinaryTreeNode node1 = new BinaryTreeNode(1); Binary 阅读全文
posted @ 2021-10-19 23:19 code-G 阅读(53) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.LinkedList; import java.util.Map; import java.util.Queue; /** * 获取二叉树的宽度 */ public class BinaryTreeWidth { 阅读全文
posted @ 2021-10-19 17:04 code-G 阅读(116) 评论(0) 推荐(0) 编辑