Reverse digits of an integer. Example1: x =
123, return 321 Example2: x = -123, return –321 这道题应该不用详细说了。比较简单。唯一的是要注意特殊值0.
public class Solution { publ...
分类:
其他好文 时间:
2014-05-24 01:39:59
阅读次数:
170
题目:Two elements of a binary search tree (BST) are
swapped by mistake.Recover the tree without changing its structure.Note:A
solution using O(n) space ...
分类:
其他好文 时间:
2014-05-23 11:31:51
阅读次数:
299
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b ="1"Return"100".public class
Solution { public String addBin...
分类:
其他好文 时间:
2014-05-19 12:15:49
阅读次数:
220
DPM源码(voc-release)中的模型可视化做的还算相当炫酷的,可以让我们直观的看到训练好的模型,甚至我们不用去做模型的评价,直接根据肉眼的观察,就能大致了解一个目标训练的好不好,比如我训练一个人体模型,那他的可视化图当然就是越接近人体越好。...
分类:
其他好文 时间:
2014-05-18 15:44:12
阅读次数:
563
【题目】
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
For example, given array S = {...
分类:
其他好文 时间:
2014-05-18 10:37:57
阅读次数:
269
【题目】
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
【题意】
给定n对括号,输出所有可行的括号组合字符串。所谓合法,就是可以Valid Pare...
分类:
其他好文 时间:
2014-05-18 09:06:41
阅读次数:
266
对于本题,想到一个中序遍历后,判别是否为回文串的方法,却WA多次
class Solution {
public:
vector vectorValue;
void inOrder(TreeNode* root)
{
if(root!=NULL)
{
inOrder(root->left);...
分类:
其他好文 时间:
2014-05-18 06:38:58
阅读次数:
294
3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
分类:
其他好文 时间:
2014-05-18 05:57:48
阅读次数:
244
含有n个部件的目标模型可以形式上定义为一个(n+2)元组:(F0,P1,..., Pn, b),F0是根滤波器,Pi是第i个部件的模型,b是表示偏差的实数值。每个部件模型用一个三元组定义:(Fi,vi, di),Fi是第i个部件的滤波器;vi是一个二维向量,指定第i个滤波器的锚点位置(anchor position,即未发生形变时的标准位置) 相对于根的坐标;di是一个四维向量,指定了一个二次函数的参数,此二次函数表示部件的每个可能位置相对于锚点位置的变形花费(deformation cost)。...
分类:
其他好文 时间:
2014-05-18 05:10:38
阅读次数:
353
【题目】
Implement strStr().
Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.
【题意】
实现库函数strStr(), 功能是在字符串haystack中找出目标串needle第一次出现的索引位
【思路】
字符串的匹配,可以用暴力解法,但不推荐。一般使用KMP算法求解。
简要介绍一下KMP的思想:
...
分类:
其他好文 时间:
2014-05-18 04:10:04
阅读次数:
244