- 博客(8)
- 收藏
- 关注
原创 list方法的习题
The constructor List template List :: List( ) { count = 0; } clear template voidList :: clear( ) { count = 0; } empty template boolList :: empty( ) const { return count
2013-09-26 19:38:17
596
原创 list move习题
template Error_code List :: remove( int position , List_entry &x) { if (count == 0) return underflow ; if (position =count) return range_error ; x = entry[position ];/X是被删除的元素 count −−;
2013-09-26 19:35:34
652
原创 E2题
1 Node*p0=new Node('0'); Node*p1=p0-->next=new Node('1'); 2 Node*p0=new Node ('0'); Node*p1=new Node('1'); Node*p2=new Node('2'); p2-->next=p0; 3. Node*p0=new Node('0');
2013-09-05 19:29:16
499
原创 栈的问题
1.栈的定义:栈是一种数据结构,一种只能在一端进行插入和删除操作的特殊线性表。 2.它按照后进先出的原则存储数据,先进入的数据被压入栈底,最后的数据在栈顶,需要读数据的时候从栈顶开始弹出数据,最后一个数据被第一个读出来。允许在同一端进行插入和删除操作的特殊线性表。允许进行插入和删除操作的一端称为栈顶(top),另一端为栈底(bottom);栈底固定,而栈顶浮动;栈中元素个数为零时称为空栈。插
2013-09-05 19:28:20
643
原创 E7题
#include #include using namespace std; const int maxqueue=30; enum Error_code{success,underflow,overflow}; typedef int Queue_entry; class Queue{ public: Queue(); bool empty(
2013-08-29 18:21:42
525
原创 E2题
#include #include #include"Stack.h" const int maxstack=31; enum Error_code{success,overflow,underflow}; typedef int Stack_entry; class Stack{ bool empty() const; Error_code cop
2013-08-29 18:20:10
576
原创 栈的习题(1),(2)。
栈可以看作铁道交换网。编号为 1 , 2,…n的车厢停在左车道上,当车厢停在右车道上时,要对它们进行重新排列(改序排列)可以将支线(栈)上的车厢留在那儿或者发送到右车道上,但不能将它再送回到进来时的车道。例如,如果n=3并且我们将车厢 1、2、3停在左车道上,则车厢3最先到达支线。然后我们可以将车厢2发送到支线,然后放在去右车道的路上,再将车厢3发送上路.然后是车厢1,因此获得的新序列为1、3、2
2013-08-25 06:59:22
955
1
原创 编程设计
1.命名规则Guidelines for Choosing Names n 文档格式Documentation Guidelines n 逐步求精及模块化中的编程准则Refinement and Modularity n 自顶向下Top-down design and Refinement: n 工作分配Division of work: n 数据分类Categories of Dat
2013-08-20 22:29:14
490
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅