9.11
来源:互联网 发布:健康体检报告软件 编辑:程序博客网 时间:2024/06/10 06:52
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.3E2
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;
}
- 9.11
- 9.11
- 9.11
- 9.11
- hw 9.11
- 9.6-9.11
- 9.11总结
- 黄迪明9.11
- 周记9.11
- 9.11总结
- 9.11 库函数简介
- maximo7观感(9.11更新)
- 上课小练习9.11
- HTML(9.11)
- 9.11学习笔记
- 开发手记9.11
- 9.11学习总结
- 9.11 编程练习
- sae出现的错误
- linux网络服务器模型(转)
- 泛型
- cocos2d-x学习之自动内存管理和常见宏
- Unix/Linux C++应用开发-C++类的继承
- 9.11
- J2SE学习总结
- Android --- 循检获取服务器信息
- Force Download with HTTP Headers
- Perl精华教程
- HDU 4726 Kia's Calculation热身赛2 1011题(贪心 每次都找最大位的放在前面)
- Unix/Linux C++应用开发-C++模板
- MySQL数据库加密与解密
- 说明