摘要: #includeusing namespace std;const int maxqueue = 10;class Queue{public:Queue( );bool empty( ) const;Error_code serve( );Error_code append(const Queue_entry item);Error_code retrieve(Queue_entry item) const;protected:int front,rear;Queue_entry entry [maxqueue];bool is_empty; };Queue :: Queue( ){rear 阅读全文
posted @ 2013-08-29 18:25 百度一下吉吉 阅读(228) 评论(0) 推荐(0)
摘要: Error_code copy_stack(Stack &dest,Stack &source){ Error_code detected=success; Stack temp; Stack_entry item; while(detected==success&&!source.empty()}{ detected=source.top(item); detected=source.pop(); if(detected==success)detected=temp.push(item); }while (detected==success&& 阅读全文
posted @ 2013-08-29 18:24 百度一下吉吉 阅读(102) 评论(0) 推荐(0)