摘要: Next.js的页面预渲染有两种形式 静态生成 在需要页面预渲染的js文件中 export async function getStaticProps(context) { //通知next.js页面需要预渲染的属性 //xxx操作 return { props:{},//props属性 reval 阅读全文
posted @ 2022-06-08 21:03 code-G 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(122) 评论(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) 编辑
摘要: import java.util.Stack; //二叉树的各种遍历 递归及非递归 public class BinaryTreeTraversal { public static void main(String[] args) { BinaryTreeNode node1 = new Binar 阅读全文
posted @ 2021-10-18 21:28 code-G 阅读(36) 评论(0) 推荐(0) 编辑
摘要: /** * 如果两个链表相交,求相交的节点 */ public class TwoLinkedList { public static void main(String[] args) { Node node1 = new Node(1); Node node2 = new Node(2); Nod 阅读全文
posted @ 2021-10-18 20:15 code-G 阅读(56) 评论(0) 推荐(0) 编辑