
数据结构
CheriYu
我本微末凡尘,可也心向天空。
展开
-
java实现单向链表CRUD,反转,排序,查找倒数第k个元素,递归输出等操作
package myLink;import javax.xml.transform.Templates;public class LianBiao { static Node head=null; /** * 查找单链表的中间节点 * */ public Node getMid(){ Node p=head; Node q=原创 2017-08-03 09:41:09 · 744 阅读 · 0 评论 -
二叉树
package shujujiegou;public class BinaryTree { private Node root=null; public BinaryTree(){ root=new Node(1,"A"); } //创建一个二叉树 public void createTree(Node root){ Node n原创 2017-08-10 16:34:15 · 345 阅读 · 0 评论 -
直接插入排序
//时间复杂度:n^2,稳定package shujujiegou;public class InsertSort { static final int SIZE=10; static void insertsort(int a[]){ int i,j,t,h; for(i=1;i<a.length;i++){ t=a[i];原创 2017-09-03 14:50:57 · 226 阅读 · 0 评论