码迷,mamicode.com
首页 >  
搜索关键字:divide and conquer    ( 1165个结果
第2章 熟悉Eclipse开发工具:加减乘除,和差积商的英文写法
加减乘除表示运算:plus minus multiply divide和差积商表示运算结果:sum difference product quotient
分类:系统相关   时间:2015-04-02 14:37:42    阅读次数:243
拒绝switch,程序加速之函数指针数组
先看一个使用switch语句的程序: #include #include //加法 int add(int a,int b) { return a+b; } //减法 int subtract(int a,int b) { return a-b; } //乘法 int multi(int a,int b) { return a*b; } //除法 int divide(int ...
分类:编程语言   时间:2015-04-02 13:27:17    阅读次数:195
[leetcode] Divide Two Integers
Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.思路:类似二分查找算法,只不过我们做的是对...
分类:其他好文   时间:2015-04-02 13:10:11    阅读次数:114
HDU 4751 Divide Groups(判断是否为二分图)
#include #include #include #include #include #include #include #include #define LL long long #define FOR(i, x, y) for(int i=x;i<=y;i++) using namespace std; const int MAXN = 100 + 10; struct E...
分类:其他好文   时间:2015-04-02 11:42:47    阅读次数:131
算法中的递归分析和分治法的原理
分析递归算法三种方法替换法、迭代法、通用法(master method)作用:分析递归算法的运行时间分治算法将一个问题分解为与原问题相似但规模更小的若干子问题,递归地解这些子问题,然后将这些子问题的解结合起来构成原问题的解。这种方法在每层递归上均包括三个步骤:divide(分解):将问题划分为若干个...
分类:编程语言   时间:2015-03-31 21:50:49    阅读次数:225
【leetcode】Divide Two Integers
题意:不用乘除取余操作求除法 思路: 1、如果循环一个个把因子从被除数中减去,那么如果是INT_MAX或者INT_MIN除以1的情况,执行时间会很长 2、改善时间效率的方法采用将因子divisor不断乘以2(可以通过移位实现,同时结果ret也从1不断移位加倍),然后和被除数比较,等到大于等于被除数一...
分类:其他好文   时间:2015-03-30 16:11:29    阅读次数:131
归并排序
本文转载自白话经典算法 归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。 首先考虑下如何将将二个有序数列合并。这个非常简单,只要从比较二个数列的第一个数,谁小就先取谁,取了后就在对应数列中删除这个数。然后再进行比...
分类:编程语言   时间:2015-03-29 14:56:43    阅读次数:162
leecode 题解 || Merge k Sorted Lists 问题
problem: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Tags Divide and Conquer Linked List Heap 合并K个已序单链表 thinking:  (1)题目没有要求不可以新开ListN...
分类:其他好文   时间:2015-03-20 16:24:45    阅读次数:114
HDU 4751 Divide Groups(二分图的判断)
Problem Description   This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus back to visit and take photos.   Af...
分类:其他好文   时间:2015-03-20 09:24:12    阅读次数:110
10375 - Choose and divide
#include using namespace std; const int maxn = 10000 + 5; int e[maxn],vis[maxn]; vector primes; void add_primes() { memset(vis,0,sizeof(vis)); int m = sqrt(10000+0.5); for(int i=2;i<=m;i++...
分类:其他好文   时间:2015-03-19 18:30:44    阅读次数:164
1165条   上一页 1 ... 92 93 94 95 96 ... 117 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!