2013年8月29日

p92 E7

摘要: #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:19 _Yw丶权 阅读(118) 评论(0) 推荐(0) 编辑

P64 E2.(b)

摘要: 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:17 _Yw丶权 阅读(127) 评论(0) 推荐(0) 编辑

导航