![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
java数据结构
数据结构
njl_0114
学习 学习 学学习
展开
-
java 实现二叉树
package DataStructures.Tree; import sun.reflect.generics.tree.Tree; public class BinaryTreeDemo { public static void main(String[] args) { TreeNode t1 = new TreeNode(1); TreeNode t2 = new TreeNode(2); TreeNode t3 = new TreeNod原创 2020-11-07 23:21:59 · 71 阅读 · 1 评论 -
java 单链表
public class MyLink { Node head; int linksize; public MyLink(){ head = null; linksize = 0; } public MyLink(int val){ head = new Node(val); linksize = 1; } public void insertTail(int val) { Node p = new Node(val); if(head == null) head.原创 2020-08-23 20:53:00 · 105 阅读 · 0 评论 -
java实现单链表
public class Node { public Node(int val){ this.val = val; this.next = null; }; Node next; protected int val; } public class MyLink { Node head; int linksize; public MyLink(){ head = null; linksize = 0; } public MyLink(int val){ head原创 2020-07-27 13:52:58 · 91 阅读 · 0 评论