Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Subscribe to see which companies asked this questio
分类:
其他好文 时间:
2016-03-18 21:46:29
阅读次数:
208
Sort a linked list in O(n log n) time using constant space complexity. 链表的归并排序。 /** * Definition for singly-linked list. * struct ListNode { * int val
分类:
其他好文 时间:
2016-03-09 01:21:31
阅读次数:
138
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh
分类:
其他好文 时间:
2016-03-07 01:21:12
阅读次数:
136
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. AC代码: def mergeKLists_merge_sort(self, lists): def
分类:
其他好文 时间:
2016-03-02 01:39:52
阅读次数:
155
For a given sorted array (ascending order) and atarget number, find the first index of this number inO(log n) time complexity. If the target number do
分类:
其他好文 时间:
2016-02-24 19:02:07
阅读次数:
172
29. Divide Two Integers Problem's Link ---------------------------------------------------------------------------- Mean: 略 analyse: 略 Time complexity
分类:
其他好文 时间:
2016-02-19 18:59:57
阅读次数:
117
问题描述: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in
分类:
其他好文 时间:
2016-02-14 23:41:02
阅读次数:
286
原题链接在这里:https://leetcode.com/problems/wiggle-sort/ 当 i 是奇数时,若nums[i] < nums[i-1], 互换。 当 i 是偶数时,若nums[i] > nums[i-1], 互换。 Time Complexity: O(n). Space:
分类:
其他好文 时间:
2016-02-11 11:08:52
阅读次数:
150
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or
分类:
其他好文 时间:
2016-02-07 13:35:21
阅读次数:
219
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh
分类:
其他好文 时间:
2016-02-01 02:12:35
阅读次数:
105