码迷,mamicode.com
首页 >  
搜索关键字:greedy    ( 311个结果
贪心算法(Greedy Algorithm)之最小生成树 克鲁斯卡尔算法(Kruskal's algorithm)
克鲁斯卡尔算法(Kruskal's algorithm)是两个经典的最小生成树算法的较为简单理解的一个。这里面充分体现了贪心算法的精髓。大致的流程能够用一个图来表示。这里的图的选择借用了Wikipedia上的那个。很清晰且直观。首先第一步,我们有一张图,有若干点和边例如以下图所看到的:第一步我们要做...
分类:其他好文   时间:2014-06-22 09:46:37    阅读次数:194
CF10E Greedy Change 判断硬币系统是否能用贪心策略
Billy investigates the question of applying greedy algorithm to different spheres of life. At the moment he is studying the application of greedy algo...
分类:其他好文   时间:2014-06-18 15:17:54    阅读次数:272
GPS-Graph Processing System Graph Coloring算法分析 (三)
Graph coloring is the problem of assigning a color to each vertex of an undirected graph such that no two adjacent vertices have the same color. We implement the greedy algorithm from Scalable parallel graph coloring algorithms. The algorithm iteratively f...
分类:其他好文   时间:2014-06-10 07:10:19    阅读次数:260
Leetcode: Text Justification. java
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that i...
分类:编程语言   时间:2014-06-08 15:25:00    阅读次数:282
Leetcode: Wildcard Matching. java
Implement wildcard pattern matching with support for '?' and '*'.public class Solution { public boolean isMatch(String s, String p) { if (s == null || p == null) return false; if (...
分类:编程语言   时间:2014-06-08 03:10:46    阅读次数:216
LeetCode--Best Time to Buy and Sell Stock (贪心策略 or 动态规划)
LeetCode Problem -- Best Time to Buy and Sell Stock Greedy Algorithms 贪心算法...
分类:其他好文   时间:2014-06-05 04:36:58    阅读次数:239
LeetCode: Text Justification [068]
【题目】 Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad ...
分类:其他好文   时间:2014-06-04 22:37:46    阅读次数:389
ZOJ 3794 Greedy Driver spfa
题意: 给定n个点,m条有向边,邮箱容量。 起点在1,终点在n,开始邮箱满油。 下面m行表示起点终点和这条边的耗油量(就是长度) 再下面给出一个数字m表示有P个加油站,可以免费加满油。 下面一行P个数字表示加油站的点标。 再下面一个整数Q 下面Q行 u v 表示在u点有销售站,可以卖掉邮箱里的任意数量的油,每以单位v元。 问跑到终点能获得最多多少元。 先求个每个点的最大剩...
分类:其他好文   时间:2014-06-02 18:58:48    阅读次数:306
独木舟问题
以前一直一位set.end()是代表最后一个元素,原来只是个标记,怪不得一直出错,同时erase在multiset中会删除相同的元素。 本题很明显的greedy,排列后前后两个元素能否组合,不能删除最大元素,再组合,写的比较蠢,不想改了#include #include using namespace std; int main() { int N; cin>>N; while(N--) ...
分类:其他好文   时间:2014-05-25 11:19:57    阅读次数:227
黑马程序员 ---------- Java网络技术之 ---正则表达式 (Day06)
---------------------- ASP.Net+Unity开发、.Net培训、期待与您交流! ---------------------- 正则表达式 正则表达式:基本知识 1  字符,   2 字符类 , 3 预定义字符类 , 4 边界匹配器 ,5 Greedy 数量词,6 Logical 运算符  详解: 1 字符  x   字符 x ...
分类:编程语言   时间:2014-05-11 21:33:34    阅读次数:481
311条   上一页 1 ... 29 30 31 32 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!