数据结构实验:链表与栈实现.pdfVIP

  • 1
  • 0
  • 约3.62千字
  • 约 6页
  • 2026-03-13 发布于北京
  • 举报

实验二:

typedefintDataType;#

includeiostream.h

classListNode{public:DataTypedata;ListNode*next;

ListNode(constDataTypeitemval,ListNode*ptrnext=

NULL){data=itemval;next=ptrnext;}ListNode(ListNode

*ptrnext=NULL){next=ptrnext;}};

classStack{public:Stack(){top==

NULL;}~Stack(){Clear();}void

Push(

文档评论(0)

1亿VIP精品文档

相关文档