摘要: Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
posted @ 2015-03-16 16:49 jasmine_turnsoul 阅读(145) 评论(0) 推荐(0)
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2015-03-16 15:13 jasmine_turnsoul 阅读(176) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?思路:... 阅读全文
posted @ 2015-03-16 11:23 jasmine_turnsoul 阅读(120) 评论(0) 推荐(0)
摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2015-03-16 09:45 jasmine_turnsoul 阅读(148) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-03-16 09:10 jasmine_turnsoul 阅读(136) 评论(0) 推荐(0)
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:1. 一般做... 阅读全文
posted @ 2015-03-16 08:44 jasmine_turnsoul 阅读(107) 评论(0) 推荐(0)