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 order of O(log
n).
If the target is not found in...
分类:
其他好文 时间:
2015-01-12 09:29:25
阅读次数:
119
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
...
分类:
其他好文 时间:
2015-01-12 09:27:17
阅读次数:
136
题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum elemen....
分类:
编程语言 时间:
2015-01-12 06:47:23
阅读次数:
173
# -*- coding: utf8 -*-'''https://oj.leetcode.com/problems/median-of-two-sorted-arrays/There are two sorted arrays A and B of size m and n respectively...
分类:
编程语言 时间:
2015-01-12 01:34:26
阅读次数:
214
Given two sorted arrays A, B of size m and n respectively. Find the k-th smallest element in the union of A and B. You can assume that there are no du...
分类:
其他好文 时间:
2015-01-11 22:48:15
阅读次数:
187
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.代码:oj测试通过Runtime:178 ms 1 # Definition...
分类:
编程语言 时间:
2015-01-11 20:18:51
阅读次数:
235
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array....
分类:
其他好文 时间:
2015-01-11 17:53:05
阅读次数:
140
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 order of O(log n).
If the target is not found ...
分类:
其他好文 时间:
2015-01-11 17:51:10
阅读次数:
190
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2015-01-11 15:59:32
阅读次数:
181
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with...
分类:
其他好文 时间:
2015-01-11 14:55:05
阅读次数:
164