摘要:
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. Recursiv 阅读全文
摘要:
Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? if use space O(1), we need to use 阅读全文
摘要:
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 典型的2 pointer 问题,一个走的快,一个走到慢,如果是cycle就一定会 阅读全文