摘要: 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 { get { return num; } set { num = val 阅读全文
posted @ 2011-03-27 00:55 山之松 阅读(117) 评论(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 @ 2011-03-27 00:50 山之松 阅读(149) 评论(0) 推荐(0) 编辑
摘要: namespace DSList{ public interface IStack<T> { int GetLength(); //求栈的长度 bool IsEmpty(); //判断栈是否为空 void Clear(); //清空操作 void Push(T item); //入栈操作 T Pop(); //出栈操作 T GetTop(); //取栈顶元素 }} 阅读全文
posted @ 2011-03-27 00:48 山之松 阅读(76) 评论(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 DbLinkList() { head = n 阅读全文
posted @ 2011-03-27 00:43 山之松 阅读(117) 评论(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 @ 2011-03-27 00:40 山之松 阅读(158) 评论(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 = null; } //base methods public i 阅读全文
posted @ 2011-03-27 00:37 山之松 阅读(107) 评论(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 { return next; } set { next = value; } } // constructo 阅读全文
posted @ 2011-03-27 00:31 山之松 阅读(154) 评论(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; } } public int Last { get { retur 阅读全文
posted @ 2011-03-27 00:26 山之松 阅读(1140) 评论(0) 推荐(0) 编辑
摘要: 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 Locate(T item); //按值查找}} 阅读全文
posted @ 2011-03-27 00:22 山之松 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2011-03-25 01:16 山之松 阅读(224) 评论(0) 推荐(0) 编辑