c#数据结构———栈
栈是栈是受约束的链表,栈是一种后进先(LIFO)出的数据结构。 using System; using LinkedListLibrary; // 栈是受约束的链表 // 栈底结点的链接成员社为 null namespace StackInheritanceLibrary { public class StackInheritance:List { public StackInheritance(): base ("stack") { } public void Push( object dataValue) // 压栈 { InsertAtFront(dataValue); } public object Pop() // 出栈 { return RemoveFromFront(); } } } 第二种实现方法 using System; using LinkedListLibrary; // 通过合成来重用 List 类 namespace StackCompositionLibrary { public class StackComposition:List { public List stack; public StackComposition() { stack = new List("stack"); } public void Push( object