摘要: 1 public class Node{ 2 public long data; 3 public Node next; 4 5 public Node(long value){ 6 this.data = value; 7 } 8 ... 阅读全文
posted @ 2015-06-02 19:32 疯狂的蜗牛仔 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1.栈2.队列栈:一种先进后出的线性数据结构。也是一种特殊的线性表结构,其特殊性在于限定插入和删除数据元素的操作只能在线性表的一端进行。 1 public class Stack{ 2 private long[] arr; 3 private int top; 4 5 ... 阅读全文
posted @ 2015-06-02 19:25 疯狂的蜗牛仔 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 数组在数据结构中的作用是非常重要的,所以要学好数据结构与算法,首先就要对数组有必要的了解和熟悉。实例采用面向对象的思想,对数组进行操作。声明long型的数组,元素内长度为element。private long[] arr;private int element;1 //无参构造函数2 public... 阅读全文
posted @ 2015-06-02 14:57 疯狂的蜗牛仔 阅读(184) 评论(0) 推荐(0) 编辑