花间一壶酒

导航

2012年2月16日 #

二叉树-链式存储-Java实现(未完待续)

摘要: package com.wrh.lab.dataStructure.tree;/** * the node of the binary tree * @author wrh * */public class BinaryNode<E> { private E element; //the element private BinaryNode<E> left; //the left point private BinaryNode<E> right; //the right point /** * build an node * ... 阅读全文

posted @ 2012-02-16 17:29 wrh526 阅读(225) 评论(0) 推荐(0) 编辑

稀疏矩阵转换为三元组

摘要: package com.wrh.lab.dataStructure.arrayAndGenericTable;/** * * @author wrh *SparseMatrix convert to Three Tuple */public class SparseMatrixToThreeTuple { public static void main(String[] args) { int[][] data = { {0,0,0,0,0,0}, {0,3,0,0,0,0}, ... 阅读全文

posted @ 2012-02-16 17:25 wrh526 阅读(715) 评论(0) 推荐(0) 编辑

数组按行/列优先存储转换

摘要: package com。wrh.lab.dataStructure.arrayAndGenericTable;/** * test the array convert * @author wrh * */public class ArrayConvert { public static void main(String[] args) { int[][] data = {{1,2,3,4},{5,6,7,8},{9,10,11,12}}; int[] rowData = new int[12]; int[] colData = new int[... 阅读全文

posted @ 2012-02-16 17:23 wrh526 阅读(499) 评论(0) 推荐(0) 编辑

队列- 链式存储-Java实现

摘要: package com.wrh.lab.dataStructure.stackAndQueue;/** * the interface of queue * @author wrh * * @param <E> */public interface Queue<E> { /** * enqueue the element * @param element */ public void enqueue(E element); /** * * @return the dequeue element */ pu... 阅读全文

posted @ 2012-02-16 17:20 wrh526 阅读(246) 评论(0) 推荐(0) 编辑

循环队列-顺序存储-Java实现

摘要: package com.wrh.lab.dataStructure.stackAndQueue;/** * the interface of queue * @author wrh * * @param <E> */public interface Queue<E> { /** * enqueue the element * @param element */ public void enqueue(E element); /** * * @return the dequeue element */ pu... 阅读全文

posted @ 2012-02-16 17:17 wrh526 阅读(472) 评论(0) 推荐(0) 编辑

栈-链式存储-Java实现

摘要: package com.wrh.lab.dataStructure.stackAndQueue;/** * the interface of the SeqStack * @author wrh * * @param <E> */public interface Stack<E> { /** * push the element to the stack * @param element */ public void push(E element); /** * pop the element from the stack an... 阅读全文

posted @ 2012-02-16 17:14 wrh526 阅读(265) 评论(0) 推荐(0) 编辑

栈-顺序存储-Java实现

摘要: package com.wrh.lab.dataStructure.stackAndQueue;/** * the interface of the SeqStack * @author wrh * * @param <E> */public interface Stack<E> { /** * push the element to the stack * @param element */ public void push(E element); /** * pop the element from the stack an... 阅读全文

posted @ 2012-02-16 17:12 wrh526 阅读(190) 评论(0) 推荐(0) 编辑

循环链表-链式存储-Java实现

摘要: package com.wrh.lab.dataStructure.linearList;/** * * @author wrh * the interface of the linked list * */public interface LinkedList<E> { /** * insert the item at prior * @param item */ public void insertAtPrior(E item); /** * insert the item at the end of the list... 阅读全文

posted @ 2012-02-16 17:08 wrh526 阅读(197) 评论(0) 推荐(0) 编辑

单链表-链式存储-Java实现

摘要: package com.wrh.lab.dataStructure.linearList;public class SingleListNode<E> { private SingleListNode<E> next; private E data; public SingleListNode(E data) { this.data = data; next = null; } public SingleListNode(E data, SingleListNode<E> nextNode) { this.... 阅读全文

posted @ 2012-02-16 17:04 wrh526 阅读(211) 评论(0) 推荐(0) 编辑

链表-顺序存储-Java实现

摘要: package com.wrh.lab.dataStructure.linearList;/** * * @author wrh * the interface of linear list. * */public interface LinearList<E> { /** * identify whether the list is empty or not * @return true for empty and false for not empty */ public boolean isEmpty(); /** * ... 阅读全文

posted @ 2012-02-16 17:00 wrh526 阅读(328) 评论(0) 推荐(0) 编辑