2.2
来源:互联网 发布:内存卡怎么恢复数据 编辑:程序博客网 时间:2024/05/16 07:10
Implement an algorithm to find the nth to last element of a singly linked list.
分析:查找链表倒数第n个元素,这在剑指offer上有相同的习题
Node* get_lastn(Node* head,int n){if(head==NULL||n<=0) return NULL;Node* front=head;Node* behind=head;while(n>1){behind=behind->next;if(behind==NULL) return NULL;n--;}while(behind->next!=NULL){front=front->next;behind=behind->next;}return front;}
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- 2.2
- orangehrm-2.2.2.2 中文包
- 2.2-1 & 2.2-2
- 2.2-3 & 2.2-4
- FCKEditor 2.2
- eclipse3.2.2
- Android 2.2
- 2.2 preface
- 15个CSS3和jQuery的超棒页面过渡效果教程
- jquery基本介绍
- Xmanager 远程连接Linux桌面
- Web_CSS_如何替代页面样式表?
- Android mainfest文件 android属性 汇总
- 2.2
- 安卓之service学习总结
- SDR SDRAM控制器的
- mysql引擎
- 路由器下再接路由器 (可供多台设备使用)的配置方法
- SQL Server错误代码大全及解释(留着备用)
- SQL>下使用COPY命令复制或转移数据
- jquery制作简单计算器
- print,出现SyntaxError: invalid syntax