Vertex Cover Problem's Link Mean:给你一个无向图,让你给图中的结点染色,使得:每条边的两个顶点至少有一个顶点被染色。求最少的染色顶点数。 analyse:裸的最小点覆盖问题,二分图的最大匹配,直接套模版即可。 Time complexity:...
分类:
其他好文 时间:
2015-10-02 21:15:26
阅读次数:
190
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2015-10-01 23:07:04
阅读次数:
309
Fenwick Tree is perfect for this problem, though space complexity is not quite efficient.class Solution { ////////////////// // Fenwick Tree // ...
分类:
其他好文 时间:
2015-10-01 11:32:57
阅读次数:
147
【POJ】 Instant Complexity (模拟)
Instant Complexity
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 1905
Accepted: 657
Description
Analyzing the ru...
分类:
其他好文 时间:
2015-09-30 13:05:59
阅读次数:
201
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODE...
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:
编程语言 时间:
2015-09-29 16:29:58
阅读次数:
179
背景Problem(问题)Web sites are turning into Web apps(网站正转变为网络应用程序)Code complexity grows as the site gets bigger(代码复杂度随着站点变大而变复杂)Assembly gets harder(组装变得更...
分类:
Web程序 时间:
2015-09-26 20:01:08
阅读次数:
258
/*Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. */#include #include#include#include#includeusing ...
分类:
其他好文 时间:
2015-09-26 14:35:28
阅读次数:
212
QuestionMergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Solution 1 -- Merge SortWe can follow the meth...
分类:
其他好文 时间:
2015-09-22 06:41:04
阅读次数:
154
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:
其他好文 时间:
2015-09-17 23:07:24
阅读次数:
261