摘要: 包含了2个文件ArrayList.hpp和Main.cpp。写这份代码不仅仅是为了练习实现数据结构,还为了练习模版和函数重载。遇到过一些挫折,但是都一一解决了,感觉收获还是挺多的。 1 #ifndef __ARRAY_LIST_HPP__ 2 #define __ARRAY_LIST_HPP__ 3 4 #include "stdlib.h" 5 6 template class ArrayList 7 { 8 public: 9 const static size_t INVALID_ARRAYLIST_INDEX = -1; 10 11 typed... 阅读全文
posted @ 2013-08-31 22:41 秀逗小虫虫 阅读(266) 评论(0) 推荐(0)
摘要: 最近练手谢了一些数据结构的实现。 贴在博客里边,方便以后查阅。//CircleQueue.hpp 1 #ifndef __CIRCLE_QUEUE_HPP__ 2 #define __CIRCLE_QUEUE_HPP__ 3 4 template class CircleQueue 5 { 6 public: 7 const static size_t CIRCLE_QUEUE_INVALID_INDEX = -1; 8 const static size_t CIRCLE_QUEUE_DEFAULT_CAPACITY = 5; 9 const static siz... 阅读全文
posted @ 2013-08-31 22:32 秀逗小虫虫 阅读(217) 评论(0) 推荐(0)