上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 转载自董的博客本文链接地址:http://dongxicheng.org/structure/knapsack-problems/1 背包问题介绍背包问题不单单是一个简单的算法问题,它本质上代表了一大类问题,这类问题实际上是01线性规划问题,其约束条件和目标函数如下:自从dd_engi在2007年推... 阅读全文
posted @ 2015-04-13 11:06 imKirin 阅读(279) 评论(0) 推荐(0) 编辑
摘要: Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen... 阅读全文
posted @ 2015-04-07 14:04 imKirin 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 转自陈皓专栏:http://blog.csdn.net/haoel/article/details/1948051C++ 虚函数表解析陈皓http://blog.csdn.net/haoel前言C++中 的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然... 阅读全文
posted @ 2015-04-03 15:21 imKirin 阅读(120) 评论(0) 推荐(0) 编辑
摘要: const用法1,定义全局变量的内存分配问题#define Pi_1 3.14 //使用#define宏const double Pi_2 = 3.14 //使用const,这时候Pi并没有放入内存中double a = Pi_2; //这时候才为Pi分配内存,不过后面再有这样的定义也不会再分配内存... 阅读全文
posted @ 2015-04-03 14:46 imKirin 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.思路:类似二分查找算法,只不过我们做的是对... 阅读全文
posted @ 2015-04-02 11:32 imKirin 阅读(146) 评论(0) 推荐(0) 编辑
摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions. 1 class Solutio... 阅读全文
posted @ 2015-03-30 15:02 imKirin 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1 /* Jeff Somers 2 * 3 * Copyright (c) 2002 4 * 5 * jsomers@alumni.williams.edu 6 * or 7 * allagash98@yahoo.com 8 * 9 * April, 2002 10... 阅读全文
posted @ 2015-03-30 14:36 imKirin 阅读(535) 评论(0) 推荐(0) 编辑
摘要: N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all... 阅读全文
posted @ 2015-03-30 14:24 imKirin 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文
posted @ 2015-03-27 10:32 imKirin 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substr... 阅读全文
posted @ 2015-03-20 15:22 imKirin 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页