摘要: 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.分析:就是使用两个指针,让较小的归并到新的list上:代码:方法一:1234567891011121314151617... 阅读全文
posted @ 2017-01-03 22:43 copperface 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linke... 阅读全文
posted @ 2017-01-03 22:42 copperface 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all valid but ... 阅读全文
posted @ 2017-01-03 22:42 copperface 阅读(131) 评论(0) 推荐(0) 编辑