摘要: namespace DSList{ public interface IListDS<T> { int GetLength(); //求长度 bool IsEmpty(); //判断线性表是否为空 void Clear(); //清空操作 void Append(T item); //追加操作 void Insert(int pos, T item); //插入操作 T Remove(int pos); //删除操作 T GetElem(int pos); //取表元 int L... 阅读全文
posted @ 2013-04-26 15:54 小泥巴1024 阅读(95) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public partial class SeqList<T> : IListDS<T> where T:IComparable<T> { //fields private T[] data; private int last; private int maxsize; //properties public T this[int index] { get { return data[index]; } set { data[index] = value; ... 阅读全文
posted @ 2013-04-26 15:44 小泥巴1024 阅读(747) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class Node<T> { // fields private T data; //Data domain private Node<T> next; //Next reference domain // properties public T Data { get { return data; } set { data = value; } } public Node<T> Next { get ... 阅读全文
posted @ 2013-04-26 15:41 小泥巴1024 阅读(145) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public partial class LinkList<T> : IListDS<T> where T:IComparable<T> { //fields private Node<T> head; //property public Node<T> Head { get { return head; } set { head = value; } } //constructor public LinkList() { head = nul... 阅读全文
posted @ 2013-04-26 15:40 小泥巴1024 阅读(104) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class DbNode<T> { /// <summary> /// fields /// </summary> private DbNode<T> prev; //Previous reference domain private T data; //Data domain private DbNode<T> next; //Next reference domain /// <summary> /// properties /// </summary> p 阅读全文
posted @ 2013-04-26 15:39 小泥巴1024 阅读(105) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public partial class DbLinkList<T> : IListDS<T> where T : IComparable<T> { private DbNode<T> head; //Head reference domain //Head property public DbNode<T> Head { get { return head; } set { head = value; } } //Constructor public D... 阅读全文
posted @ 2013-04-26 15:37 小泥巴1024 阅读(117) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public interface IStack<T> { int GetLength(); //求栈的长度 bool IsEmpty(); //判断栈是否为空 void Clear(); //清空操作 void Push(T item); //入栈操作 T Pop(); //出栈操作 T GetTop(); //取栈顶元素 }} 阅读全文
posted @ 2013-04-26 15:35 小泥巴1024 阅读(136) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public partial class SeqStack<T> : IStack<T> where T:IComparable<T> { /// <summary> /// fields /// </summary> private int maxsize; private T[] data; private int top; /// <summary> /// properties /// </summary> public int Maxsize { get { ret 阅读全文
posted @ 2013-04-26 10:50 小泥巴1024 阅读(90) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class LinkStack<T> : IStack<T> { //Fields private Node<T> top; //Top reference indicator private int num; //Node quantity //Properties public Node<T> Top { get { return top; } set { top = value; } } public int Num ... 阅读全文
posted @ 2013-04-26 10:48 小泥巴1024 阅读(145) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public interface IQueue<T> { int GetLength(); //求队列的长度 void Clear(); //清空操作 bool IsEmpty(); //判断是否为空 void In(T item); //入队操作 T Out(); //出队操作 T GetFront(); //取队头元素 }} 阅读全文
posted @ 2013-04-26 10:47 小泥巴1024 阅读(106) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class CSeqQueue<T> : IQueue<T> { //Fields private int maxsize; private T[] data; private int front; private int rear; private int count; //Properties public T this[int index] { get { return data[index]; } set { data[index] = ... 阅读全文
posted @ 2013-04-26 10:37 小泥巴1024 阅读(116) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class LinkQueue<T> : IQueue<T> { //Fields private Node<T> front; private Node<T> rear; private int count; //Properties public Node<T> Front { get { return front; } set { front = value; } } public Node<T> Rear { get ... 阅读全文
posted @ 2013-04-26 10:36 小泥巴1024 阅读(91) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class StringDS { //Field private char[] data; //Properties public char this[int index] { get { return data[index]; } set { data[index] = value; } } //Constructors public StringDS(char[] arr) { data = new char[arr.L... 阅读全文
posted @ 2013-04-26 10:33 小泥巴1024 阅读(110) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class TreeNode<T> { private T data; private TreeNode<T> lChild; private TreeNode<T> rChild; public T Data { get { return data; } set { data = value; } } public TreeNode<T> LChild { get { return lChild; } ... 阅读全文
posted @ 2013-04-26 10:26 小泥巴1024 阅读(148) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class BinaryTree<T> where T:IComparable<T> { //Field private TreeNode<T> head; //Property public TreeNode<T> Head { get { return head; } set { head = value; } } //Constructors public BinaryTree(T val, TreeNode<T> lc, TreeNo... 阅读全文
posted @ 2013-04-26 10:24 小泥巴1024 阅读(124) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class HfmNode { private int flag; //标记 private int weight; //权植 private int lChild; //左孩子下标 private int rChild; //右孩子下标 private int parent; //双亲结点下标 public int Flag { get { return flag; } set { flag = value; } ... 阅读全文
posted @ 2013-04-26 10:23 小泥巴1024 阅读(102) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public class HuffmanTree { private HfmCode[] hfmCode; private HfmNode[] hfmNode; public HfmCode getHfmCode(int index) { return hfmCode[index]; } public void setHfmCode(int index,HfmCode hfcode) { hfmCode[index] = hfcode; } public HfmNode getHfmNode(int ind... 阅读全文
posted @ 2013-04-26 10:18 小泥巴1024 阅读(119) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public interface IGraph<T> { int GetNumOfVertex(); //获取顶点的数目 int GetNumOfEdge(); //获取边的数目 bool IsGvNode(GvNode<T> v); //v是否为图的顶点 int GetIndex(GvNode<T> v); //获得顶点V在顶点数组中的索引 void SetEdge(GvNode<T> v1, GvNode<T> v2, int v); //在顶点v1和v2之间添加权值为v的边 void DelE 阅读全文
posted @ 2013-04-26 10:17 小泥巴1024 阅读(93) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ //无向图邻接矩阵的顶点结点类(Undirected Graph Adjaceney Matrix of Vertex Node) public class GvNode<T> { private T data; public T Data { get { return data; } set { data = value; } } public GvNode(T val) { data = val; } }} 阅读全文
posted @ 2013-04-26 10:16 小泥巴1024 阅读(132) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ //无向图邻接矩阵类(Undirected Graph Adjacency Matrix Class) public class GraphAdjMatrix<T> : IGraph<T> { //Fields private GvNode<T>[] nodes; //vertex array private int numEdges; //Edges number private int[,] matrix; //Matrix array //Constructor public GraphAdjMatrix(int . 阅读全文
posted @ 2013-04-26 10:12 小泥巴1024 阅读(154) 评论(0) 推荐(0) 编辑