list方法的习题
来源:互联网 发布:网速流量监控软件 编辑:程序博客网 时间:2024/05/19 00:15
The constructor List
template < class List_entry >
List < List_entry > :: List( )
{
count = 0;
}
clear
template < class List_entry >
voidList < List_entry > :: clear( )
{
count = 0;
}
empty
template < class List_entry >
boolList < List_entry > :: empty( ) const
{
return count <=0;
}
full
template < class List_entry >
boolList < List_entry > :: full( ) const
{
return count >=max_list;
}
replace
template < class List_entry >
Error_code List < List_entry > :: replace( int position , const List_entry &x)
{
if (position < 0 || position >=count) return range_error ;
entry[position ] = x;
return success;
}
retrieve
template < class List_entry >
Error_code List < List_entry > :: retrieve( int position , List_entry &x) const
{
if (position < 0 || position >=count) return range_error ;
x = entry[position ];
return success;
}
双向
template < class List_entry >
Error_code List < List_entry > :: remove( int position , List_entry &x)
{
Node< List_entry >*prior,*current;
if (count == 0) return fail ;
if (position < 0 || position >=count) return range_error ;
if (position > 0) {
prior= set_position(position − 1) ;
current = prior->next;
prior->next= current->next;
}
else {
current = head;
head = head->next;
}
x = current->entry;
delete current;
count −−;
return success;
}
- list方法的习题
- List的【addAll(List list)】方法
- list move习题
- List的contains()方法
- List的contains()方法
- List的contains()方法
- List的contains()方法
- list arraylist的方法
- List的contains()方法
- list 方法的实现
- list 方法的实现
- list 方法的实现
- list 方法的实现
- List的部分方法
- List的遍历方法
- List常用的方法
- List的contains方法
- List的常用方法
- Exercise3.3
- java反射之获取Class对象
- 食品安全
- 在二元树中找出和为某一值的所有路径
- 如何得到ClistBox当前选择的内容,以及如何初始化CListBox.删除当前选择的内容
- list方法的习题
- remove
- 【CN精品系统】《 Ghost_Win7 SP1 电脑公司通用版 v4.0 》 装机版
- C#中的泛型
- `DllImport' could not be found 错误
- REMOVE
- strcpy和memcpy的区别
- 最近一周笔试面试总结
- sort命令的k选项大讨论