摘要: #include using 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 :: Qu... 阅读全文
posted @ 2013-08-29 18:26 Mr。Pei。oO 阅读(141) 评论(0) 推荐(0)
摘要: Error_code copy_stack(Stack &dest,Stack &source){Erroe_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==succes&&!temp.emp 阅读全文
posted @ 2013-08-29 18:23 Mr。Pei。oO 阅读(120) 评论(0) 推荐(0)
摘要: (a)3 1 2(b)1 4 2 3 2 4 1 3 3 1 2 4 3 1 4 2 3 4 1 2 4 1 2 3 4 1 3 2 4 2 1 3 4 2 3 1 4 2 3 1 4 3 1 2 阅读全文
posted @ 2013-08-24 07:55 Mr。Pei。oO 阅读(121) 评论(1) 推荐(0)
摘要: 数据结构是一门研究非数值性程序设计中计算机操作的对象以及它们相互之间关系的学科。 数据结构需要考虑的是数据在计算机存储器内的存储方式和对这种存储方式的逻辑描述,以及针对这些数据的各种操作。任何一种数据结构都是由基本元素组成的,这种基本元素在不同的场合,有时又称为结点、顶点、记录等。 算法是能被机械地执行的动作(或称规则、指令)的有穷集合,一个动作的一次执行称为一步。算法具有以下特点: (1)输入 (2)输出(3)确定性 (4)有穷性 (5)有效性 算法复杂度的概念 算法分析:对设计出的算法进行性能优劣评价。 主要研究的是按照算法设计的程序在运行时需运行的时间和占用的空间。根据算法编写出的程序. 阅读全文
posted @ 2013-08-20 19:15 Mr。Pei。oO 阅读(334) 评论(0) 推荐(0)