![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
jiashuaizhang
本人现在正在上学,对计算机领域充满了兴趣,希望和大家一起学习、发展、创造。
展开
-
在Java中对单链表的一系列操作
链表的定义 public class ListNode { int val; ListNode next; public ListNode(int x) { this.val = x; this.next = null; } } 向链表中依次向后插入节点 public ListNode insertNode(ListNode head, int val) { /** * 插入节点 */ if(head == nu...原创 2020-07-31 19:31:26 · 202 阅读 · 0 评论 -
在Java中对树的一系列操作
对树节点的定义 public class TreeNode { protected int val ; protected TreeNode left; protected TreeNode right; public TreeNode(int val) { this.val = val; this.left = null; this.right = null; } public TreeNode(i原创 2020-07-30 11:06:53 · 163 阅读 · 0 评论