Exercises4.2 And Exercises4.3
来源:互联网 发布:淘宝一淘官方网站 编辑:程序博客网 时间:2024/05/16 15:34
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;
}
- Exercises4.2 And Exercises4.3
- Exercises4.1
- Exercises4.1
- Exercises4.2E2(a)4.3E2
- Exercises4.1 E1
- Exercises4.1 E2
- 数据结构队列Exercises4.1E1,E2
- 2D and 3D Graphics
- HOJ 2528 1 2 and 3
- jQuery 1.10.2 and 2.0.3 Released
- Difference between Python 2 and Python 3
- differences in python 2 and python 3
- Modern Sublime Text 3 and 2 theme
- MyBatis(iBatis 3) and Spring and Struts2
- Errors and Signals and Traps - Part 2
- career cup: 1.6 and 1.7 and 2
- 33,3 and 3
- Service and Binder(3)
- CF 86D Powerful array
- 4行CSS实现表格内容超过一行的部分,用省略号代替
- hive 数据查询
- 文件映射IO:mmap-mprotect-msync-munmap函数族
- 单臂路由实现三层路由数据包转发及数据包格式分析
- Exercises4.2 And Exercises4.3
- [HTML]表单form的method属性get/post区别
- 详解Node.js API系列C/C++ Addons(3) 程序实例
- 在文件中同时grep多个关键字
- kernel panic
- perl学习(2) 基本数据类型等
- Ajax学习
- 详解Node.js API系列 Module模块(2) 案例分析
- HTML特殊字符的html、js、css写法汇总