随笔分类 -  DataStruct

摘要:View Code 1 #include<iostream> 2 #include<assert.h> 3 using namespace std; 4 5 //const int maxSize=50; 6 const int stackIncreament=20; 7 8 9 10 template<class T> class Stack 11 { 12 public: 13 Stack(){}; //由于没写{},一直报错。undefined reference to Stack<int>::stack 注意模板的分离编译。 14 vir 阅读全文
posted @ 2011-11-14 02:27 YipWingTim 阅读(511) 评论(0) 推荐(0)
摘要:头文件LinkedList.hView Code 1 //LinkedList.h 2 #include<iostream> 3 #ifndef LINKEDLIST_H_INCLUDED 4 #define LINKEDLIST_H_INCLUDED 5 6 #endif // LINKEDLIST_H_INCLUDED 7 8 using namespace std; 9 10 //const int NULL=0; 11 12 template <class Type> struct LinkNode 13 { 14 public: 15 Type d... 阅读全文
posted @ 2011-11-03 00:50 YipWingTim 阅读(617) 评论(0) 推荐(0)