摘要: 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 阅读(94) 评论(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 阅读(147) 评论(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 阅读(117) 评论(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 阅读(92) 评论(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 阅读(111) 评论(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 阅读(150) 评论(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 阅读(103) 评论(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 阅读(120) 评论(0) 推荐(0) 编辑