- 博客(9)
- 收藏
- 关注
原创 Homework Remove
Error_code List::remove(int position, List_entry &x){if(count==0)return underflow;if(position=count)return range_error;x=entury[position];for(int i=position;ientry[i]=entry[i+1];coun
2013-09-24 08:49:52 384
原创 Exercise4.2E2(a) Exercise4.3E2
Exercises 4.2 E2 Consider a linked stack that includes a method size .That method size requires a loop that moves through the entire stack to count the entires,since the number of entries in the sta
2013-09-09 22:39:22 446
原创 Exercise 4.1
Exercise 4.1 E1 Draw a diagram to illustrate the configuration of linked nodes that is created by the following statements. Node *p0=new Node(‘0’) Node *p1=p0->next=new Node(‘1’);
2013-09-04 13:05:06 373
原创 Programming Projects3.4
P1 Complete the menu-driven demonstration program for manipulating an Extended _queue of characters,by implementing the function get_command and completing the function do_command. #includeusin
2013-09-04 11:06:39 324
原创 Exercises 3.3 E7
E7 Rewrite the methods for queue processing from the text ,using a flag to indicate a full queue instead of keeping a count of the entries in the queue The class definition for this Queue imp
2013-08-28 20:08:59 454
原创 从C到C++
命名空间namespace省略头文件的“.h”,改用命名空间。例如下面语句:#include 应写成#include using namespace std;注意早期版本的C++并不支持该方法。初始化变量之()方法int x(0); 等价于 int x=0;int x(0),y(2); 等价于 int x=0,y=2;事实上,这是构造函数的一个应用。变量
2013-08-26 22:37:01 372
原创 Exercises2.2 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);
2013-08-26 22:32:48 370
原创 Exercise2.1 E4(数据结构与程序设计)
(a)There are five permutations :123 132 213 321 312(b)There are 14 such permutations:1234 1243 1324 1423 1432 2134 21433124 3214 4123 4132
2013-08-23 19:50:37 508
原创 Self--Study Chapter One (Summary programme principle)
Self--Study Chapter One (Summary programme principle)一The Game of Life解决方案:类,对象和方法1类,对象(class object):在C++中,我们使用类(class)来组合数据和用于访问或修改这写数据的方法,数据和方法这样的组合称为属于给定类的对象。Fo
2013-08-20 20:50:05 480 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人