![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 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 · 2882 阅读 · 0 评论 -
suffix tree pattern matching
// A simple C++ implementation of substring search using trie of suffixes #include #include #define MAX_CHAR 256 using namespace std; // A Suffix Trie (A Trie of all suffixes) Node class SuffixTrie原创 2014-09-28 16:14:18 · 514 阅读 · 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 · 505 阅读 · 0 评论