自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(50)
  • 资源 (1)
  • 收藏
  • 关注

转载 opencv轮廓相关的函数

typedef struct CvSeq{    CV_SEQUENCE_FIELDS()}CvSeq;#define CV_CONTOUR_FIELDS()  \    CV_SEQUENCE_FIELDS()     \    CvRect rect;             \    int color;               \    int

2015-03-08 16:05:40 556

转载 Java开发工程师必备精品资料(115个)

Java应用广泛,涉及个人PC、数据中心、游戏控制台、科学超级计算机、移动电话和互联网等领域,同时拥有全球最大的开发者专业社群。小弟精心整理了115个精品资料,包括11个Java开发专题和104个热门资源。网上的资料众多,参差不齐,然而这批资料确实经过精心整理的,下载量高,好评众多。附件较多,无法将附件一一分享给大家,只能提供资料地址了。希望对大家有帮助!14个Java企业开发技术实训实验

2014-10-25 23:36:43 1449

转载 深入学习C语言知识点checklist

深入学习C语言知识点checklist——测试你掌握C的程度的答案    前些日子在网上转载了一篇日志《关于深入学习C语言知识点checklist——测试你掌握C的程度》,这篇文章的引用真是无所不在,但找不到关于它的答案。于是突发奇想,用了两天时间整理了篇答案。全是自己的见解,希望对大家的学习有帮助。一.字符串(1)strlen()函数的返回值是什么类型的? 

2014-09-19 00:13:03 678

转载 各种字符串Hash函数比较

unsigned int SDBMHash(char *str){ unsigned int hash = 0; while (*str) { // equivalent to: hash = 65599*hash + (*str++); hash = (*str++) + (hash << 6) + (hash << 16) - has

2014-09-15 20:44:22 414

转载 虚函数与构造函数、析构函数

一、构造函数能不能是虚函数: 1.1从存储空间角度虚函数对应一个vtable,这大家都知道,可是这个vtable其实是存储在对象的内存空间的。问题出来了,如果构造函数是虚的,就需要通过 vtable来调用,可是对象还没有实例化,也就是内存空间还没有,怎么找vtable呢?所以构造函数不能是虚函数。1.2从使用角度虚函数主要用于在信息不全的情况下,能使重载的函数得到对应的调用。构造函

2014-09-15 19:41:44 575

转载 Bloom Filter概念

二、适用范围在计算机科学中,我们常常会碰到时间换空间或者空间换时间的情况,即为了达到某一个方面的最优而牺牲另一个方面。Bloom Filter在时间空间这两个因素之外又引入了另一个因素:错误率。在使用Bloom Filter判断一个元素是否属于某个集合时,会有一定的错误率。也就是说,有可能把不属于这个集合的元素误认为属于这个集合(False Positive),但不会把属于这个集合

2014-09-09 10:09:37 356

转载 海量数据处理:十个海量数据处理方法总结

第一部分、十道海量数据处理面试题1、海量日志数据,提取出某日访问百度次数最多的那个IP。      首先是这一天,并且是访问百度的日志中的IP取出来,逐个写入到一个大文件中。注意到IP是32位的,最多有个2^32个IP。同样可以采用映射的方法,比如模1000,把整个大文件映射为1000个小文件,再找出每个小文中出现频率最大的IP(可以采用hash_map进行频率统计,然后再找出频率

2014-09-09 09:53:04 1229

转载 素数

1. 根据概念判断:如果一个正整数只有两个因子, 1和p,则称p为素数.代码:bool isPrime(int n){ if(n < 2) return false; for(int i = 2; i < n; ++i) if(n%i == 0) return false; return true;}时间复杂度O(n).

2014-09-08 22:42:12 402

转载 O(N lgK) 时间内合并K个有序链表

问题:在O(N lgK) 时间内合并K个有序链表, 这里N指的是K个链表中所有的元素个数。分析:这是一道非常经典的面试题,在很多大公司的面试题中,此题频繁出现。这题也是算法导论的作业题。这题的思路如下:1) 在每一个链表中取出第一个值,然后把它们放在一个大小为K的数组里,然后把这个数组当成heap,然后把该堆建成最小堆。此步骤的时间复杂度为O(K)2

2014-09-08 13:46:59 1273

原创 [Leetcode] Convert Sorted List to Binary Search Tree

题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.由

2014-08-24 00:17:12 322

原创 [Leetcode] Convert Sorted Array to Binary Search Tree

题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.

2014-08-23 23:37:40 278

原创 [Leetcode] Construct Binary Tree from Inorder and Postorder Traversal

题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.y

2014-08-23 23:33:42 381

原创 [Leetcode] Construct Binary Tree from Preorder and Inorder Traversal

题目:Given preorder and inorder traversal of a tree, construct the binary tree.根据前序遍历和中序遍历构造

2014-08-23 21:39:51 375

原创 [Leetcode] Flatten Binary Tree to Linked List

题目:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like:

2014-08-22 11:27:44 212

原创 [Leetcode] Binary Tree Level Order Traversal

题目:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9

2014-08-22 00:50:22 339

原创 [Leetcode] Combination Sum II

题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums toT.Each number in C may only be used once in the

2014-08-18 17:57:45 284

原创 [Leetcode] Combination Sum

题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlim

2014-08-18 17:01:58 293

原创 [Leetcode] Merge k Sorted Lists

题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.感觉就是上一题的

2014-08-18 15:05:54 303

原创 [Leetcode] Merge Two Sorted Lists

题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.纯链表拆分zao

2014-08-18 11:21:02 288

原创 [Leetcode] Permutations II

题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,

2014-08-16 14:29:52 362

原创 [Leetcode] Permutations

题目:Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].要求生成一个

2014-08-15 22:12:14 370

原创 [Leetcode] Balanced Binary Tree

bool balflag=true;int Balanced(TreeNode *x){ if (x == NULL) return 0; int leftDepth = Balanced(x->left); int rightDepth = Balanced(x->right); if(abs(leftD

2014-08-11 19:45:28 371

原创 [Leetcode] Combinations

题目:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3],

2014-08-11 16:52:58 380

原创 [Leetcode] Partition List

题目:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in

2014-08-11 15:50:09 265

原创 [Leetcode] Maximum |Minimum Depth of Binary Tree

题目一:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.等同于寻找树的深度,

2014-08-11 10:39:55 327

原创 [Leetcode] Sum Root to Leaf Numbers

题目:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find t

2014-08-10 23:21:14 278

原创 [Leetcode] Binary Tree Postorder Traversal

题目:Given a binary tree, return the postorder traversal of its nodes' values. 后序遍历二叉树

2014-08-10 22:48:34 297

原创 [Leetcode] Binary Tree Preorder Traversal

题目:Given a binary tree, return the preorder traversal of its nodes' values.

2014-08-10 22:47:57 274

原创 [Leetcode] Divide Two Integers

题目:Divide two integers without using multiplication, division and mod operator.

2014-08-09 21:37:11 301

原创 [Leetcode] Rotate List

题目:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.

2014-08-09 11:19:00 251

原创 [Leetcode] Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found

2014-08-08 17:51:00 246

原创 [Leetcode] Pow(x, n)

问题:实现 pow(x, n).

2014-08-07 00:32:50 430

原创 [Leetcode] Generate Parentheses

vector str;char a='(';char b=')';void rankkuohao(string s, char c, int nl, int nr){ if( c !='k') s.push_back(c); if(nl==0 &&nr==0) { str.push_back(s); s.clear(); }; if( nr > nl) { if

2014-08-06 10:03:51 256

原创 [Leetcode] Best Time to Buy and Sell Stock I | III

题目:通过两次购买和抛售使

2014-08-05 21:18:02 305

原创 动态规划——最长公共子序列

LCS(Longest Common Length)最长公共子序

2014-08-04 23:15:07 461

原创 [Leetcode] Count and Say

问题:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off

2014-07-27 16:03:44 289

原创 [Leetcode] Remove Duplicates from Sorted List I | II

题目二:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Giv

2014-07-27 13:07:40 370

原创 [Leetcode] Sqrt(x)

itImplement int sqrt(int x).Compute and return the square root of x.

2014-07-27 10:38:33 264

原创 [Leetcode] Binary Tree Level Order Traversal

题目:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20

2014-07-26 22:05:53 282

原创 [Leetcode] Binary Tree Zigzag Level Order Traversal

问题:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given bi

2014-07-26 20:29:42 281

Davinci视频采集驱动

Davinci视频采集驱动

2013-08-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除