摘要: 题目: Reverse a singly linked list. 思路: 以1—>2->3->4为例,链表反转的过程如下: 第一次循环结束: head: 2->3->4->NULL newhead: 1->NULL 第二次循环结束: head: 3->4->NULL newhead: 2->1-> 阅读全文
posted @ 2017-05-04 13:04 Sindyang 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 阅读全文
posted @ 2017-05-04 10:49 Sindyang 阅读(96) 评论(0) 推荐(0) 编辑