
算法
文章平均质量分 67
zhaobaoxue
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
给定两个长度相同,分别有序的数组A和B,求两个数组中所有数的中位数
该题目比Leetcode中的题目Median of Two Sorted Arrays 稍简单,因为两个数组的长度相同。 解法转自 http://www.cnblogs.com/qianye/archive/2013/05/06/3063980.html给定两个数组A和B,数组的长度相同都为n,两个数组都分别有序,要求出两个数组中所有数的中位数。分析:两个数组中总共有2n个转载 2014-03-16 15:00:34 · 3000 阅读 · 0 评论 -
suffix tree pattern matching
// A simple C++ implementation of substring search using trie of suffixes#include #include #define MAX_CHAR 256using namespace std;// A Suffix Trie (A Trie of all suffixes) Nodeclass SuffixTrie原创 2014-09-28 16:14:18 · 589 阅读 · 0 评论 -
count duplicate in a sorted array
count insead of find. binary search.#include #include using namespace std;map blist; void count_dup(int* arr, int start, int end){ if(end == start) { blist[arr[start]] +=1;原创 2014-10-14 12:02:11 · 577 阅读 · 0 评论