问题描述:
输入:空间平面上点集Q 输出:距离最近的两个点对
问题简化:如果是在一个直线上找最近的点对,则可以使用排序,之后找最近最近点。
分治思路:
Divide 将其划分为两个部分Q1,Q2 T(n) = O(n)
Conquer 分别找最近点对, T(n) = 2T(n/2)
Merge 比较分开点附近的两个点距离和找出的的距离T(n)= O(...
分类:
编程语言 时间:
2014-11-26 16:31:10
阅读次数:
216
security groypsSecurity groups--> are sets of IP filter rules() that ,define networking access,are applied toall instances within a projectdefault se....
分类:
其他好文 时间:
2014-11-26 11:10:43
阅读次数:
205
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.参考:http://www.cnblogs.com/AnnieKim/ar...
分类:
其他好文 时间:
2014-11-26 01:08:54
阅读次数:
190
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
思路:对每一个单词的所有字母按照字典顺序排序,排序结果作为key,所有具有相同key的单词组合在一起成为一个Anagram group。最后返回所有的Anag...
分类:
其他好文 时间:
2014-11-25 23:42:35
阅读次数:
195
设计过程分为三个阶段
Divide: 整个问题划分为多个子问题 T(n)=D(n)
Conquer:求解各子问题(递归调用正设计的算法) T(n)=aT(n/b)
Combine:合并子问题的解, 形成原始问题的解T(n)=C(n)
Note: 将规模为n的问题划分为a个子问题,每个问题的大小为n/b。(b可能不等于a!)
时间复...
分类:
编程语言 时间:
2014-11-25 10:46:48
阅读次数:
222
这是别处看来转载到此处,原网址已找不到Symbols+plus/'pl?s/-minus/'ma?n?s/±plusorminus/'pl?s?:'ma?n?s/xmultipliedby/'m?lt?pla?dba?//over;dividedby/'??v?//d?'va?d?d/÷divide...
分类:
其他好文 时间:
2014-11-24 20:50:25
阅读次数:
305
1[self.groups valueForKeyPath:@"name"]指groups 是一组group对象的数据,group对象里name的属性那么上面的意思就是返回每个group对象里name属性的值[group valueForKey:@"name"] 指是返回这个group对象里的nam...
分类:
编程语言 时间:
2014-11-23 13:00:10
阅读次数:
173
大概有这几种:Runtime Error(ARRAY_BOUNDS_EXCEEDED) // array bounds exceed 数组越界Runtime Error(DIVIDE_BY_ZERO) //divisor is nil 除零Runtime Error(ACCESS...
分类:
其他好文 时间:
2014-11-22 00:44:18
阅读次数:
279
here we just want to divide a simple string with blank space within it , such as " hello world " .char buff[256]=" hello world ";and we have two gene....
分类:
其他好文 时间:
2014-11-21 16:05:21
阅读次数:
186
Divide two integers without using multiplication, division and mod operator.代码:class Solution {private: int res;public: int solve(long long divi...
分类:
其他好文 时间:
2014-11-20 11:45:17
阅读次数:
146