(1)二叉树 package ChapterEight; class Tree { class Node { public long value; public Node leftChild; public Node rightChild; public Node(long value) { this.value = value; leftChild = null; rightChild = null; } } public Node root; public Tree() { root = ...
(1)简单链表 package ChapterFive; class Link<E> { public E data; public Link<E> next; public Link(E data) { this.data = data; } } class LinkList<E> { public Link<E> first; //链表中数据项的个数 public int size; public LinkList() { first = null; size = 0; } ...
(1)栈 package ChapterOne; public class Stack { //栈数组 long stackArr[]; //栈的大小 int maxSize; //栈的顶部 int top; //初始化一个大小为size的栈 public Stack(int size){ maxSize = size; stackArr = new long[size]; top = -1; } //出栈操作 public long pop(){ return stackArr[top--]; } //进栈操 ...
马上要找工作了,所以的把原来的重要的课程再回顾一下,我重要复习的是数据结构,在网上下了<<Java数据结构和算法>>这本书,准备用3个星期看完.看到不如做到,做到不如写到,我的记忆力不是很好,为了看了之后不会忘记,我把学习的体会和程序代码贴上来,以供以后参考. (1)冒泡排序 package ChapterOne; public class Bubble { public static void main(String[] args) { Bubble b = new Bubble(); for(int i = 0;i < arr.length;i+ ...
yongsky
搜索本博客
我的相册
0b9f1bec-1b7f-4869-8996-7faf4379c57e-thumb
Image00000
共 3 张
存档
最新评论