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 or...
分类:
其他好文 时间:
2014-09-11 22:10:12
阅读次数:
187
Sorting It All Out
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 28055
Accepted: 9689
Description
An ascending sorted sequence of distinct values is one ...
分类:
其他好文 时间:
2014-09-11 21:00:22
阅读次数:
168
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。...
分类:
其他好文 时间:
2014-09-11 17:28:02
阅读次数:
207
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 ...
分类:
其他好文 时间:
2014-09-10 17:36:20
阅读次数:
172
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-09-10 09:26:30
阅读次数:
198
最近找工作,免不了看CC150 刷 LeetCode 来练手,练习之余也向各路大神 系统并且深入的学习、巩固一下算法知识。一. 线性表1. 数组 Remove Duplicates from Sorted Array Remove Duplicates from Sorted Array II .....
分类:
其他好文 时间:
2014-09-10 08:21:50
阅读次数:
246
1 public class Solution { 2 public boolean search(int[] A, int target) { 3 int low=0, high=A.length-1; 4 while (low=target) low=m...
分类:
其他好文 时间:
2014-09-09 23:02:39
阅读次数:
217
1 public class Solution { 2 public int search(int[] A, int target) { 3 int low=0, high=A.length-1; 4 5 while (lowA[mid] ...
分类:
其他好文 时间:
2014-09-09 21:30:09
阅读次数:
178
Median of Two Sorted Arrays...
分类:
其他好文 时间:
2014-09-09 13:29:48
阅读次数:
158
我觉着写得比看到的答案更清晰~
class Solution {
public:
TreeNode *ltob(ListNode *head, ListNode *end) {
if(head == end) {
TreeNode * node = new TreeNode(head->val);
return node;...
分类:
其他好文 时间:
2014-09-09 12:56:58
阅读次数:
166