74、链表编程:从基础到高级应用

链表编程:从基础到高级应用

1. 有序链表的插入与删除方法编程实践

在这个编程活动中,我们要处理一个整数的有序链表,主要任务是编写插入和删除节点的方法。

操作步骤
  1. 准备工作 :从相关网站将本章节“Programming Activity 2”文件夹的内容复制到计算机的文件夹中,然后打开 LinkedList.java 源文件。在源文件中搜索五个星号( * ),定位到需要添加代码的部分。
  2. 插入方法编码 :在 insert 方法中编写代码,实现将整数插入有序链表的功能。示例代码如下:
public void insert( int value ) 
{ 
    // ***** Student writes the body of this method ***** 
    // code the insert method of a linked list of ints 
    // the int to insert in the linked list is value 

    // 
    // Student code starts here 
    // 


    // 
    // End of student code, part 1 
    // 
} 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值