码迷,mamicode.com
首页 >  
搜索关键字:voting algorithm    ( 11828个结果
Leetcode | First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sho...
分类:其他好文   时间:2014-05-16 02:58:54    阅读次数:249
Binary Tree Zigzag Level Order Traversal
原题: 题目解析:这个问题的实质是要我们按成访问二叉树的结点,并返回每层访问的结果,这里要求走Z字,其实就是一行正向一行反向。 /* the kernel idea is visit a binary search tree in level and the additional work we have to label the end of one level. */ v...
分类:其他好文   时间:2014-05-15 23:18:46    阅读次数:515
CareerCup之1.7 Set Matrix Zeroes
【题目】 原文: 1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0. 译文: 写一个函数处理一个MxN的矩阵,如果矩阵中某个元素为0,那么把它所在的行和列都置为0. 【分析】 【思路一】 遍历一次矩阵...
分类:其他好文   时间:2014-05-15 12:27:37    阅读次数:293
poj2135(简单的最小费用流问题)
题目链接:http://poj.org/problem?id=2135 Farm Tour Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10862   Accepted: 4024 Description When FJ's f...
分类:其他好文   时间:2014-05-15 11:24:14    阅读次数:348
poj3469(最大流最小割问题)
题目链接:http://poj.org/problem?id=3469 Dual Core CPU Time Limit: 15000MS   Memory Limit: 131072K Total Submissions: 18147   Accepted: 7833 Case Time Limit: 5000MS ...
分类:其他好文   时间:2014-05-15 06:23:05    阅读次数:271
[LeetCode] K sum(2Sum、3Sum、4Sum)
2Sum & 3Sum & 4Sum & KSum...
分类:其他好文   时间:2014-05-15 05:33:56    阅读次数:270
LeetCode--Single Number II
Single Number II  Total Accepted: 14472 Total Submissions: 44420My Submissions Given an array of integers, every element appears three times except for one. Find that single one. Note: Y...
分类:其他好文   时间:2014-05-15 01:23:42    阅读次数:273
LeetCode--Linked List Cycle
Linked List Cycle  Total Accepted: 17148 Total Submissions: 49300My Submissions Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra sp...
分类:其他好文   时间:2014-05-15 00:13:50    阅读次数:279
Best Time to Buy and Sell Stock III
Total Accepted: 8400 Total Submissions: 38235 My Submissions Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profi...
分类:其他好文   时间:2014-05-14 19:39:53    阅读次数:275
hdu 开门人和关门人
/* * hdu OpenDoorManAndCloseDoorMan * date 2014/5/13 * state AC */ #include #include #include #include using namespace std; struct DoorMan { char name[20]; int startH,startM,startS; ...
分类:其他好文   时间:2014-05-14 14:58:40    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!