摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
namespace DSList{ public interface IStack<T> { int GetLength(); //求栈的长度 bool IsEmpty(); //判断栈是否为空 void Clear(); //清空操作 void Push(T item); //入栈操作 T Pop(); //出栈操作 T GetTop(); //取栈顶元素 }} 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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); //按值查找}} 阅读全文