摘要:
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th 阅读全文
posted @ 2017-10-25 17:08
daniel456
阅读(102)
评论(0)
推荐(0)
摘要:
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-10-25 16:46
daniel456
阅读(95)
评论(0)
推荐(0)
摘要:
You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2017-10-25 16:26
daniel456
阅读(179)
评论(0)
推荐(0)
摘要:
You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2017-10-25 16:10
daniel456
阅读(108)
评论(0)
推荐(0)
摘要:
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2017-10-25 16:07
daniel456
阅读(114)
评论(0)
推荐(0)
摘要:
Sort a linked list in O(n log n) time using constant space complexity. 含义:为一个列表排序,要求空间复杂度为常量 思路:使用归并排序 1 public class Solution { 2 public ListNode sor 阅读全文
posted @ 2017-10-25 16:03
daniel456
阅读(91)
评论(0)
推荐(0)
摘要:
Sort a linked list using insertion sort. 含义:用插入排序来对列表进行排序 思路:可以构建一个临时的链表,然后将待排序的链表的每一个节点插入到临时链表中 // 插入排序 public ListNode insertionSortList(ListNode he 阅读全文
posted @ 2017-10-25 15:50
daniel456
阅读(86)
评论(0)
推荐(0)
摘要:
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2017-10-25 15:49
daniel456
阅读(104)
评论(0)
推荐(0)
摘要:
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文
posted @ 2017-10-25 15:39
daniel456
阅读(90)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-10-25 15:37
daniel456
阅读(110)
评论(0)
推荐(0)

浙公网安备 33010602011771号