Java手写背包、栈、队列、链表以及一些常用类
2018-03-16 21:41
393 查看
Java手写背包、栈、队列、以及链表以及一些常用类
一 : 栈一package Stack;public class Stack<Item> {
private Item[] Goods; //这里初始化会报错:Cannot create a generic array of Item ,不支持泛型数组
public int Position; //栈顶元素下标,初始为-1,一个元素时为0
public int Capacity;
@SuppressWarnings("unchecked")
public Stack(){
this.Capacity=16; //默认容量为16
this.Position=-1;
this.Goods=(Item[]) new Object[this.Capacity];
}
@SuppressWarnings("unchecked") //不检查类型安全
public Stack(int Capacity){
this.Capacity=Capacity; //设置容量为Capacity
this.Position=-1; //没有元素时当前位置为-1,一个元素时,栈顶元素下标为0
this.Goods=(Item[]) new Object[this.Capacity]; // 不能使用泛型数组,必须强制转型
}
public int push(Item item) {
if(this.Capacity-1<=this.Position) { //当容量放满了的时候,容量加倍
@SuppressWarnings("unchecked")
Item[] backup=(Item[]) new Object[this.Capacity<<1];
for(int i=0;i<this.Capacity;i++) {
backup[i]=this.Goods[i];
}
this.Capacity=this.Capacity<<1; //乘二
this.Goods=backup;
System.out.println("背包扩容为 : "+this.Capacity);
}
this.Goods[++this.Position]=item; //注意此处与pop的区别,一个为++this.Position,一个为this.Position--,一个符号在前,一个在后
return this.Position;
}
public Item pop() {
if(isEmpty()) return null; //可以返回空值,当栈为空
return this.Goods[this.Position--];
}
public boolean isEmpty() {
return this.Position==-1;
}
public int size() {
return this.Position+1;
}
}
二: 栈二package Stack;
public class Stack2<Item> {
private Object[] Goods; // 这里初始化会报错:Cannot create a generic array of Item
public int Position; // 栈顶元素下标,初始为-1,一个元素时为0
public int Capacity;
public Stack2() {
this.Capacity = 16; // 默认容量为16
this.Position = -1;
this.Goods = new Object[this.Capacity];
}
public Stack2(int Capacity) {
this.Capacity = Capacity; // 设置容量为Capacity
this.Position = -1; // 没有元素时当前位置为-1,一个元素时,栈顶元素下标为0
this.Goods = new Object[this.Capacity]; // 不能使用泛型数组,必须强制转型
}
public int push(Item item) {
if (this.Capacity - 1 <= this.Position) { // 当容量放满了的时候,容量加倍
Object[] backup = new Object[this.Capacity << 1];
for (int i = 0; i < this.Capacity; i++) {
backup[i] = this.Goods[i];
}
this.Capacity = this.Capacity << 1; // 乘二
this.Goods = backup;
System.out.println("背包扩容为 : " + this.Capacity);
}
this.Goods[++this.Position] = item; // 注意此处与pop的区别,一个为++this.Position,一个为this.Position--,一个符号在前,一个在后
return this.Position;
}
@SuppressWarnings("unchecked")
public Item pop() {
if (isEmpty())
return null; // 可以返回空值,当栈为空
return (Item) this.Goods[this.Position--];
}
public boolean isEmpty() {
return this.size() == 0;
}
public int size() {
return this.Position + 1;
}
}三 : 栈三package Stack; //链表实现栈
public class Stack3<Item> {
private Node TOP;
private int N;
private class Node {
Item item;
Node next;
}
public int push(Item item) {
Node oldTOP = TOP;
TOP = new Node();
TOP.item = item;
TOP.next = oldTOP;
return ++N;
}
public Item pop() {
if (isEmpty())
return null; // 可以返回空值,当栈为空
Item reasult = TOP.item;
TOP = TOP.next;
N--;
return reasult;
}
public boolean isEmpty() {
return TOP == null;
}
public int size() {
return N;
}
} 四 : 队列一package Queue;
import Stack.Stack2;
public class Queue<Item> { // 双栈实现队列
private Stack2<Item> A;
private Stack2<Item> B;
public int Capacity;
public Queue() {
this.Capacity = 16; // 默认容量为16
this.A = new Stack2<Item>(this.Capacity);
this.B = new Stack2<Item>(this.Capacity);
}
public Queue(int Capacity) {
this.Capacity = Capacity; // 设置容量为Capacity
this.A = new Stack2<Item>(this.Capacity);
this.B = new Stack2<Item>(this.Capacity);
}
public void enqueue(Item item) {
this.A.push(item);
}
public Item dequeue() {
if (this.B.isEmpty()) {
while (!this.A.isEmpty()) {
this.B.push(this.A.pop());
}
}
return (Item) this.B.pop();
}
public boolean isEmpty() {
return this.A.size() + this.B.size() == 0;
}
public int size() {
return this.A.size() + this.B.size();
}
}五 : 队列二package Queue; //数组实现队列
public class Queue2<Item> {
private Object[] Goods;
private int Length;
public Queue2() {
Goods = new Object[16];
}
public Queue2(int Capacity) {
Goods = new Object[Capacity];
}
public void enqueue(Item item) {
if (Length + 1 >= Goods.length) {
Object[] temp = new Object[(Length << 2) + 1];
for (int i = 0; i < Length; i++) {
temp[i] = Goods[i];
}
Goods = temp;
}
Goods[Length++] = item;
}
public Item dequeue() {
if (isEmpty())
return null;
@SuppressWarnings("unchecked")
Item temp = (Item) Goods[0];
for (int i = 0; i < Length - 1; i++) {
Goods[i] = Goods[i + 1];
}
Length--;
return temp;
}
public boolean isEmpty() {
return Length == 0;
}
public int size() {
return Length;
}
}六 : 队列三package Queue;//链表实现队列
public class Queue3<Item> {
private Node first;
private Node last;
private int N;
private class Node {
Item item;
Node next;
}
public boolean isEmpty() {
return N == 0;
}
public int size() {
return N;
}
public void enqueue(Item item) {
Node oldlast = last;
last = new Node();
last.item = item;
if (isEmpty())
first = last;
else
oldlast.next = last;
N++;
}
public Item dequeue() {
if (isEmpty())
return null;
Node oldfirst = first;
first = first.next;
N--;
if (N == 0)
last = null;
return oldfirst.item;
}
}七 : 链表一(单向链表)package List;
public class List<E> {
private class Node { /// 内部类可以被任意修饰符修饰,结点类,一个单项链表的结点包括:
E ITEM; /// 一个泛型的元素
Node NEXT; /// 指向下一个结点的引用
}
public Node HEAD;
public Node TAIL;
public int SIZE;
public boolean add(E ELEMENT) {
if ((SIZE++) == 0) {
HEAD = new Node();
TAIL = HEAD;
} else {
TAIL.NEXT = new Node();
TAIL = TAIL.NEXT;
}
TAIL.ITEM = ELEMENT;
return true;
}
@Override
public String toString() {
return "List [HEAD=" + HEAD + ", TAIL=" + TAIL + ", SIZE=" + SIZE + "]";
}
public void add(int INDEX, E ELEMENT) {
if (INDEX > SIZE - 1 || INDEX < 0) {
if (INDEX == 0)
add(ELEMENT);
else {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} else {
Node Reasult = HEAD;
Node NODE = new Node();
NODE.ITEM = ELEMENT;
while ((INDEX--) > 1) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
NODE.NEXT = Reasult.NEXT;
Reasult.NEXT = NODE;
SIZE++;
}
}
public E get(int INDEX) {
if (INDEX > SIZE - 1 || INDEX < 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
} else {
Node Reasult = HEAD;
while ((INDEX--) > 0) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
return Reasult.ITEM;
}
}
public E set(int INDEX, E ELEMENT) {
if (INDEX > SIZE - 1 || INDEX < 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
} else {
Node Reasult = HEAD;
while ((INDEX--) > 0) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
E TEMP = Reasult.ITEM;
Reasult.ITEM = ELEMENT;
return TEMP;
}
}
public void remove(int INDEX) {
if (INDEX > SIZE - 1 || INDEX &l
e560
t; 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
if (INDEX == 0)
HEAD = HEAD.NEXT;
else {
Node Reasult = HEAD;
while ((INDEX--) > 1) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Reasult.NEXT = Reasult.NEXT.NEXT;
}
SIZE--;
}
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((HEAD == null) ? 0 : HEAD.hashCode());
result = prime * result + SIZE;
result = prime * result + ((TAIL == null) ? 0 : TAIL.hashCode());
return result;
}
public E[] toArray() {
@SuppressWarnings("unchecked")
E[] Array = (E[]) new Object[SIZE];
Node TEMP = HEAD;
for (int i = 0; i < SIZE; i++) {
TEMP = TEMP.NEXT;
if (i == 0)
TEMP = HEAD;
Array[i] = TEMP.ITEM;
}
return Array;
}
public boolean isEmpty() {
return SIZE == 0;
}
public void clear() {
HEAD = null;
TAIL = null;
SIZE = 0;
}
public int indexOf(E ELEMENT) {
Node Reasult = HEAD;
int INDEX = 0;
while (Reasult.NEXT != null) {
Reasult = Reasult.NEXT;
INDEX++;
if (Reasult.ITEM.equals(ELEMENT))
return INDEX;
}
return -1;
}
}八 : 链表二(双向链表)package List;
public class List<E> {
private class Node { /// 内部类可以被任意修饰符修饰,结点类,一个单项链表的结点包括:
E ITEM; /// 一个泛型的元素
Node NEXT; /// 指向下一个结点的引用
}
public Node HEAD;
public Node TAIL;
public int SIZE;
public boolean add(E ELEMENT) {
if ((SIZE++) == 0) {
HEAD = new Node();
TAIL = HEAD;
} else {
TAIL.NEXT = new Node();
TAIL = TAIL.NEXT;
}
TAIL.ITEM = ELEMENT;
return true;
}
@Override
public String toString() {
return "List [HEAD=" + HEAD + ", TAIL=" + TAIL + ", SIZE=" + SIZE + "]";
}
public void add(int INDEX, E ELEMENT) {
if (INDEX > SIZE - 1 || INDEX < 0) {
if (INDEX == 0)
add(ELEMENT);
else {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} else {
Node Reasult = HEAD;
Node NODE = new Node();
NODE.ITEM = ELEMENT;
while ((INDEX--) > 1) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
NODE.NEXT = Reasult.NEXT;
Reasult.NEXT = NODE;
SIZE++;
}
}
public E get(int INDEX) {
if (INDEX > SIZE - 1 || INDEX < 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
} else {
Node Reasult = HEAD;
while ((INDEX--) > 0) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
return Reasult.ITEM;
}
}
public E set(int INDEX, E ELEMENT) {
if (INDEX > SIZE - 1 || INDEX < 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
} else {
Node Reasult = HEAD;
while ((INDEX--) > 0) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
E TEMP = Reasult.ITEM;
Reasult.ITEM = ELEMENT;
return TEMP;
}
}
public void remove(int INDEX) {
if (INDEX > SIZE - 1 || INDEX < 0) {
try {
throw new Exception("The Index Out Of Range !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
if (INDEX == 0)
HEAD = HEAD.NEXT;
else {
Node Reasult = HEAD;
while ((INDEX--) > 1) {
if (Reasult.NEXT != null)
Reasult = Reasult.NEXT;
else {
try {
throw new Exception("The List Is Broken !");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Reasult.NEXT = Reasult.NEXT.NEXT;
}
SIZE--;
}
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((HEAD == null) ? 0 : HEAD.hashCode());
result = prime * result + SIZE;
result = prime * result + ((TAIL == null) ? 0 : TAIL.hashCode());
return result;
}
public E[] toArray() {
@SuppressWarnings("unchecked")
E[] Array = (E[]) new Object[SIZE];
Node TEMP = HEAD;
for (int i = 0; i < SIZE; i++) {
TEMP = TEMP.NEXT;
if (i == 0)
TEMP = HEAD;
Array[i] = TEMP.ITEM;
}
return Array;
}
public boolean isEmpty() {
return SIZE == 0;
}
public void clear() {
HEAD = null;
TAIL = null;
SIZE = 0;
}
public int indexOf(E ELEMENT) {
Node Reasult = HEAD;
int INDEX = 0;
while (Reasult.NEXT != null) {
Reasult = Reasult.NEXT;
INDEX++;
if (Reasult.ITEM.equals(ELEMENT))
return INDEX;
}
return -1;
}
}九 : Math类package Math;
public class Math {
public static final double PI = 3.141592653579;
public static final double E = 2.718281828459;
public static int abs(int x) {
if (x < 0)
return -x;
else
return x;
}
public static int abs(short x) {
if (x < 0)
return -x;
else
return x;
}
public static long abs(long x) {
if (x < 0)
return -x;
else
return x;
}
public static double abs(double x) {
if (x < 0.0)
return -x;
else
return x;
}
public static double abs(float x) {
if (x < 0.0)
return -x;
else
return x;
}
public static int max(int x, int y) {
return x > y ? x : y;
}
public static int max(short x, short y) {
return x > y ? x : y;
}
public static long max(long x, long y) {
return x > y ? x : y;
}
public static double max(double x, double y) {
return x > y ? x : y;
}
public static double max(float x, float y) {
return x > y ? x : y;
}
public static int min(int x, int y) {
return x > y ? y : x;
}
public static int min(short x, short y) {
return x > y ? y : x;
}
public static long min(long x, long y) {
return x > y ? y : x;
}
public static double min(double x, double y) {
return x > y ? y : x;
}
public static double min(float x, float y) {
return x > y ? y : x;
}
public static int gcd(int p, int q) {
if (q == 0)
return p;
int r = p % q;
return gcd(q, r);
}
public static boolean isPrime(int N) {
if (N < 2)
return false;
for (int i = 2; i * i < N; i++)
if (N % i == 0)
return false;
return true;
}
public static double sqrt(double c) {
if (c < 0.0)
return Double.NaN;
double err = 1e-15;
double t = c;
while (abs(t - c / t) > err * t)
t = (c / t + t) / 2.0;
return t;
}
public static double sqrt(int c) {
if (c < 0.0)
return Double.NaN;
double err = 1e-15;
double t = c;
while (abs(t - c / t) > err * t)
t = (c / t + t) / 2.0;
return t;
}
}十 : 日期类package Date;
public class Date {
private int year;
private int month;
private int day;
private int hour;
private int minute;
private int second;
public Date() {
// 空构造方法
}
public static boolean isLeapyear(int year) {
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
return true;
else
return false;
}
protected boolean CheckLawful(int[] Backups) {
int[] pmonthday = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int[] rmonthday = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int[] monthday;
if (isLeapyear(this.year))
monthday = rmonthday;
else
monthday = pmonthday;
if (this.year < 0 || this.year > 3000 || this.month < 1 || this.month > 12 || this.day < 1
|| this.day > monthday[this.month - 1] || this.hour < 0 || this.hour > 23 || this.minute < 0
|| this.minute > 59 || this.second < 0 || this.second > 59) {
try {
throw new Exception("CheckLawful Out Of Expected Value");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
this.year = Backups[0];
this.month = Backups[1];
this.day = Backups[2];
this.hour = Backups[3];
this.minute = Backups[4];
this.second = Backups[5];
}
return false;
}
return true;
}
public int[] Backup() {
int[] Backups = new int[6];
Backups[0] = this.year;
Backups[1] = this.month;
Backups[2] = this.day;
Backups[3] = this.hour;
Backups[4] = this.minute;
Backups[5] = this.second;
return Backups;
}
public Date(int year, int month, int day) {
super(); // 调用父类构造方法
int[] Backups = Backup();
this.year = year;
this.month = month;
this.day = day;
CheckLawful(Backups);
}
public Date(int year, int month, int day, int hour, int minute, int second) {
this(year, month, hour); // 一个构造方法调用另一个构造方法
int[] Backups = Backup();
this.hour = hour;
this.minute = minute;
this.second = second;
CheckLawful(Backups);
}
public void setTime(int year, int month, int day) {
int[] Backups = Backup();
this.year = year;
this.month = month;
this.day = day;
CheckLawful(Backups);
}
public void setTime(int year, int month, int day, int hour, int minute, int second) {
int[] Backups = Backup();
this.setTime(year, month, day);
this.minute = minute;
this.hour = hour;
this.second = second;
CheckLawful(Backups);
}
public String toString() { // String 可用null作为返回值
String hour, minute, second;
if (this.hour < 10)
hour = "0" + this.hour;
else
hour = Integer.toString(this.hour);
if (this.minute < 10)
minute = "0" + this.minute;
else
minute = Integer.toString(this.minute);
if (this.second < 10)
second = "0" + this.second;
else
second = Integer.toString(this.second);
return "[" + this.year + "年" + this.month + "月" + this.day + "日 " + hour + ":" + minute + ":" + second + "]";
}
public int[] toArray() {
int[] array = { this.year, this.month, this.day, this.hour, this.minute, this.second };
return array;
}
public String getTime() {
return "[" + this.year + "年" + this.month + "月" + this.day + "日]";
}
public String getTimes() {
String hour, minute, second;
if (this.hour < 10)
hour = "0" + this.hour;
else
hour = Integer.toString(this.hour);
if (this.minute < 10)
minute = "0" + this.minute;
else
minute = Integer.toString(this.minute);
if (this.second < 10)
second = "0" + this.second;
else
second = Integer.toString(this.second);
return "[" + this.year + "年" + this.month + "月" + this.day + "日 " + hour + ":" + minute + ":" + second + "]";
}
public boolean equals(Object x) {
if (this == x)
return true;
if (x == null)
return false;
if (!x.getClass().getName().equals(this.getClass().getName()))
return false;
Date c = (Date) x;
if (c.year != this.year || c.month != this.month || c.day != this.day || c.hour != this.hour
|| c.minute != this.minute || c.second != this.second)
return false;
return true;
}
public int getYear() {
return year;
}
public void setYear(int year) {
int[] Backups = Backup();
this.year = year;
CheckLawful(Backups);
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
int[] Backups = Backup();
this.month = month;
CheckLawful(Backups);
}
public int getDay() {
return day;
}
public void setDay(int day) {
int[] Backups = Backup();
this.day = day;
CheckLawful(Backups);
}
public int getHour() {
return hour;
}
public void setHour(int hour) {
int[] Backups = Backup();
this.hour = hour;
CheckLawful(Backups);
}
public int getMinute() {
return minute;
}
public void setMinute(int minute) {
int[] Backups = Backup();
this.minute = minute;
CheckLawful(Backups);
}
public int getSecond() {
return second;
}
public void setSecond(int second) {
int[] Backups = Backup();
this.second = second;
CheckLawful(Backups);
}
public static void main(String[] args) {
Date date = new Date(2018, 2, 28);
System.out.println(date);
date.setDay(29);
System.out.println(date);
BigDate bigdate = new BigDate(2018, 2, 27); // 奇怪的现象 debug出现同名变量
System.out.println(bigdate);
System.out.println(bigdate.CheckLawful(bigdate.toArray()));
}
}十一 : 背包package Bag;
import java.util.Iterator;
public class Bag<Item> {
private Node first;
private int N;
private class Node {
Item item;
Node next;
}
public void add(Item item) {
Node oldfirst = first;
first = new Node();
first.item = item;
first.next = oldfirst;
;
N++;
}
public boolean isEmpty() {
return N == 0;
}
public int size() {
return N;
}
public Iterator<Item> iterator() {
return new ListIterator();
}
private class ListIterator implements Iterator<Item> {
private Node current = first;
public boolean hasNext() {
return current != null;
}
public Item next() {
Item item = current.item;
current = current.next;
return item;
}
}
}十二 : 计数器Counterpackage Counter;
import static Math.Math.*;
public class Counter {
private String name;
private long count;
private long value;
/*
* Illegal modifier for the constructor in type Counter; only public, protected
* & private are permitted
*/
public Counter(String name) {
this.name = name;
this.count = 0;
this.value = 0;
}
public Counter() {
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public long getCount() {
return this.count;
}
public void setCount(long count) {
this.count = count;
}
public long getValue() {
return this.count;
}
public void setValue(long value) {
this.value = value;
}
public boolean equals(Object obj) {
if (obj == null)
return false;
if (!obj.getClass().getName().equals(this.getClass().getName()))
return false;
Counter c = (Counter) obj;
if (c.count == this.count && c.value == this.value)
return true;
return false;
}
@Override
public int hashCode() {
return 31 << 15 ^ 124 >>> 7;
}
public void increment() {
this.count++;
}
public void increment(int count) {
this.count += count;
}
public void addData(int value) {
this.value += value;
}
public double mean() {
return (double) this.value / this.count;
}
public long tally() {
return this.count;
}
public String toString() {
return "[name=" + this.name + ";count=" + this.count + "]";
}
public static void main(String[] args) {
Counter heads = new Counter("heads");
Counter tails = new Counter("tails");
for (int i = 0; i < 1000; i++) {
heads.increment();
try {
heads.finalize();
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
heads.addData(i);
}
tails.increment(1000);
System.out.println(heads);
System.out.println(heads.mean());
System.out.println(heads.equals(tails));
System.out.println(heads.tally());
System.out.println(heads.hashCode());
System.out.println(abs(heads.tally() - tails.tally()));
}
}
相关文章推荐
- java用数组模拟实现ArrayList以及一些常用方法实现
- [Java第一课]环境变量的配置以及eclipse一些常用快捷键
- java-栈、队列、数组、链表、Hash、树以及集合(一)
- Java中队列的实现(2)-使用单向链表以及实现
- java-栈、队列、数组、链表、Hash、树以及集合(二)
- java常用的几种数据结构,堆栈,队列,数组,链表,哈希表
- ROLLUP和CUBE语句以及一些报表常用语句
- java 栈,队列,链表,双链表,树
- java面试一些常用的问题
- JAVA的一些常用基础知识点
- 一些Java的函数和常用方法
- 8个常用的DOS命令,以及一些常用的命令集锦
- 防止java反编译的一些常用方法
- 【J2SE】Java截取字符串的一些常用处理
- 线性表,链表,哈希表是常用的数据结构,在进行Java开发时
- 工作之余,整理了一下平时处理数据的一些常用的,简单的方法。希望对学习JAVA的朋友有点帮助
- java连接sqlserver2005数据库以及其它一些数据库
- java 栈,队列,链表,双链表,树
- java 栈,队列,链表,双链表,树