2016年7月24日

队列简要实现,是queue,不是dequeue

摘要: #ifndef MYQUEUE_H#define MYQUEUE_Hstruct Node{ int data; Node *next;};class LUqueue{public: LUqueue(); ~LUqueue(); void Push(int data); in... 阅读全文

posted @ 2016-07-24 21:09 雪峰00 阅读(141) 评论(0) 推荐(0)

栈实现,不是用template做的.

摘要: 用单链表来实现栈,插入和删除的部分很有意思。写完这个感觉突然理解了书上说的适配器的观点,类就是这样,不管你底层实现是什么,表现成什么就好了,是一个黑盒。头文件Mystack.h#ifndef MYSATCK_H#define MYSTACK_Hstruct Node { in... 阅读全文

posted @ 2016-07-24 20:33 雪峰00 阅读(87) 评论(0) 推荐(0)

导航