2016年9月7日

【LeetCode】 19. Remove Nth Node From End of List 解题小结

摘要: 题目: Given a linked list, remove the nth node from the end of list and return its head. For example, 首先容易想到的是先遍历一次链表,计算链表长度L,然后再次遍历到L-n的位置删除结点。更好的办法是应用 阅读全文

posted @ 2016-09-07 12:16 医生工程师 阅读(165) 评论(0) 推荐(0) 编辑

【LeetCode】21. Merge Two Sorted Lists 解题小结

摘要: 题目: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 lis 相对还是简单的, 阅读全文

posted @ 2016-09-07 11:04 医生工程师 阅读(91) 评论(0) 推荐(0) 编辑

导航