Linklist
boegkpmlkvebevwa
这个作者很懒,什么都没留下…
展开
-
[LeetCode] Remove Duplicates from Sorted List
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, return 1->2->3. /** * Definition f原创 2014-04-02 15:52:51 · 408 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted List II
Total Accepted: 8726 Total Submissions: 35450 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2原创 2014-04-02 16:45:55 · 546 阅读 · 0 评论 -
[LeetCode] Merge Two Sorted Lists
Total Accepted: 12841 Total Submissions: 39914 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.原创 2014-04-21 10:19:56 · 450 阅读 · 0 评论 -
[LeetCode] Convert Sorted List to Binary Search Tree
Total Accepted: 9476 Total Submissions: 35578原创 2014-04-21 11:08:02 · 793 阅读 · 0 评论 -
[LeetCode] Swap Nodes in Pairs
Total Accepted: 12160 Total Submissions: 38223 Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->原创 2014-05-07 17:43:47 · 373 阅读 · 0 评论 -
[LeetCode] Linked List Cycle
Total Accepted: 14403 Total Submissions: 41497 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?原创 2014-04-08 16:26:54 · 331 阅读 · 0 评论 -
[LeetCode] Linked List Cycle II
Total Accepted: 10163 Total Submissions: 33266 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space?原创 2014-04-08 16:43:08 · 345 阅读 · 0 评论