10 2012 档案

摘要:View Code typedef int DataType;struct Node{ DataType entry; Node * next; Node(); Node(DataType item, Node * add_on = NULL);};class DyStack{public: DyStack(); bool empty() const; ErrorCode push(const DataType &item); ErrorCode pop(); ErrorCode top(DataType &item) const; ... 阅读全文
posted @ 2012-10-26 00:34 zhoutk 阅读(336) 评论(0) 推荐(0) 编辑
摘要:C#队列的循环实现:View Code class MyQueue <T> { private const int MAXLIMIT = 10; private int count; private int rear, front; private T[] entry = new T[MAXLIMIT]; public MyQueue() { count = 0; rear = MAXLIMIT - 1; front = 0; ... 阅读全文
posted @ 2012-10-24 19:42 zhoutk 阅读(912) 评论(0) 推荐(0) 编辑
摘要:C++队列的循环实现:View Code const int MAXQUEUE = 10;template<class T>class ZtkQueue {public: ZtkQueue(); bool empty() const; ErrorCode append(const T &x); ErrorCode serve(); ErrorCode retrieve (T &x)const; bool full() const; int size() const; void clear(); ErrorCode serve_and_ret... 阅读全文
posted @ 2012-10-24 00:20 zhoutk 阅读(253) 评论(0) 推荐(0) 编辑
摘要:用顺序结构(数组)与模板技术实现Stack如下:View Code class MyStack <T> { private const int MAXSTACK = 10; private int count; private T[] entry = new T[MAXSTACK]; public MyStack() { count = 0; } public bool empty() { bool outcome = true; if (count > 0) ... 阅读全文
posted @ 2012-10-16 09:52 zhoutk 阅读(299) 评论(0) 推荐(0) 编辑
摘要:用顺序结构(数组)与模板技术实现Stack如下:View Code const int MAXSTACK = 10;template<class T>class ZtkStack{public: ZtkStack(); bool empty() const; ErrorCode pop(); ErrorCode top(T &item) const; ErrorCode push(const T &item);private: int count; T entry[MAXSTACK];};template<class T>ZtkStack<T> 阅读全文
posted @ 2012-10-16 00:49 zhoutk 阅读(328) 评论(0) 推荐(0) 编辑
摘要:1、建立Win32控制台空项目;2、项目属性默认使用Unicode库,我们要关闭它,Alt+F7/Character Set/Not Set;3、添加源文件C++ File(.cpp); 最简单的示例代码:#include<iostream>int main(){ std::cout << "This is a test program!" << std::endl; std::getchar(); return 0;}注:这是使用VS2012编写标准C++代码(ISO/IEC C++),可移植性最好的方法。 阅读全文
posted @ 2012-10-11 00:21 zhoutk 阅读(311) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示