Exercise4.2E2(a) Exercise4.3E2
来源:互联网 发布:淘宝代销是怎么回事 编辑:程序博客网 时间:2024/05/22 08:09
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 stack is not kept as a separate member in the stack record.
(a)Write a method size for a linked stack by using a loop that moves a pointer variable from node to node to mode to node through the stack.
int Stack ::size()const
/Post: Return the number of entries in the Stack.*/
{
Node *temp=top_node;
int count=0;
while{temp!=NULL){
temp=temp->next;
Count ++;
}
Return count;
}
Exercise 4.3 E2
Void Stack::operator=(const Stack &original)
/Post:The Stack is reset as a copy of Stack original.*/
{
Stack new_copy(original);
Node *temp=top_node;
top_node=new_copy.top_node;
new_copy.top_node=temp;
}
- Exercise4.2E2(a) Exercise4.3E2
- Exercise4.3 E2
- Exercise 4.2 E2(a)和Exercise4.3E2
- 作业 Exercise 4.2 E2(a)和Exercise4.3E2
- Homework Exercise4.1 E1 E2
- Chapter 4 Exercise4.1 E1 E2 解答
- exercise4
- Exercises4.2E2(a)4.3E2
- E2 (a) E2
- E4.2----e2---a
- E2
- E2
- E2
- E2
- E2
- E2
- E2
- E2
- Java NIO框架Netty教程(三) – Object对象传递
- 使用git进行版本控制
- 大话设计模式九:原型模式(Prototype)
- Codeforces Round #198 (Div. 2)
- Android学习笔记
- Exercise4.2E2(a) Exercise4.3E2
- java class文件生成jar包
- UVa:10684 The jackpot
- 一、android的电话拨号器
- 字符串中的slice()
- Bit Twiddling Hacks
- STL源码--alloc
- C#通过webbrowser控件与javascript交互
- 基于Visual Studio与Google Test的单元测试框架搭建方法