码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
Search in Rotated Sorted Array I
要搜索的对象是一个rotated sorted array,所以从直觉上时间复杂度应该不会超过O(logn)。起初我想尝试修改binary search来解决这个问题,但仔细思考后发现在不断search的过程中,search的boundary是比较难确定的。解决这个题目的另一个思路就是先把pivot...
分类:其他好文   时间:2014-08-02 15:21:23    阅读次数:359
PAT---1005. Spell It Right (20)
#include#include#includechar *g_WordTable[10]= {"zero", "one", "two", "three", "four", "five","six", "seven", "eight", "nine"};int main(){ //存放用户输入...
分类:其他好文   时间:2014-08-02 12:31:53    阅读次数:530
addWindowListener -> WindowAdapter -> windowClosing
Suppose we have a framefinal JFrame jframe = new JFrame("Triangle 3");To catch window closing events and quit, there are two ways (as I know):Way1.jfr...
分类:Windows程序   时间:2014-08-02 12:14:43    阅读次数:343
[leetcode笔记] Remove Duplicates from Sorted List II
问题描述:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->...
分类:其他好文   时间:2014-08-02 01:33:12    阅读次数:249
[leetcode]Edit distance
Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You...
分类:其他好文   时间:2014-08-02 01:29:22    阅读次数:309
Merge Sorted Array
问题:将B按顺序合并到A上分析:插入排序,注意A数组为空class Solution{public: void merge(int A[], int m, int B[], int n) { int i,j; if(m==0) { ...
分类:其他好文   时间:2014-08-01 22:54:32    阅读次数:184
【HackerRank】 The Full Counting Sort
In this challenge you need to print the data that accompanies each integer in a list. In addition, if two strings have the same integers, you need to ...
分类:其他好文   时间:2014-08-01 22:40:42    阅读次数:323
Leetcode--Multiply Strings
Problem Description: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 分析:两个string相乘...
分类:其他好文   时间:2014-08-01 16:06:01    阅读次数:141
Same Tree
问题描述: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 解题思路:...
分类:其他好文   时间:2014-08-01 13:48:11    阅读次数:183
二维树状数组
Mobile phoneshttp://poj.org/problem?id=1195 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 const int M=1030; 5 class Two_Tree_Array {...
分类:其他好文   时间:2014-08-01 13:03:01    阅读次数:168
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!