Project Index

Sorry about the redirection. The failure of the Mix server has made all my projects disappear. So I made this temporary content sheet on my Chinese blog to direct to my previous...

2018/03/24 14:10
25
Algorithm - Line up Soldiers

#include <cstdio> #include <queue> #include <vector> #define MAX 30 using namespace std; int inDegree[MAX]; int visit[MAX]; int MGraph[MAX][MAX]; vector...

2018/02/06 05:45
3
Leetcode - Largest Rectangle in Histogram

dynamic programming

2018/02/06 05:10
18
Leetcode - Combination Sum

backtrack

2018/01/11 23:28
40
LeetCode - Find minimum time to finish jobs in constraints

Greedy algorithm + Binary Search

2017/12/14 11:52
408
LeetCode - Number of Islands

2017/12/14 11:29
30
Algorithm - Network Flow

1. 判断题一道 2. 然后是这道超赞的题 这道题其实分成了好几道小题，其实是在间接引导你解题： 1.如果告诉你这个maze(graph)就是一条直线 O->O->O->...->O，且每条边的capacity是1，请问让所...

2017/12/14 11:22
122
LeetCode - Trapping Rain Water

class Solution { public int maxArea(int[] height) { int n = height.length; int left = 0; int right = n-1; int leftH = heigh...

2017/12/12 11:05
3
Algorithm - Find k-th order element in a list （课堂笔记）

2017/12/12 02:48
14
Algorithm - 错题复习 midterm1&2

Midterm #1没什么好说的。。 1. 如果图是unweighted的，那么直接用BFS就能找shortest path，Dijkstra那些都是用在有权图中的。 2. 如果是unweighted & undirected图，那么BFS一次，可以把所有...

2017/12/10 03:58
22
LeetCode - Find All Duplicates in an Array

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could y...

2017/12/09 01:31
2
NP / NP-Hard / NP-Complete

https://www.cnblogs.com/Gavin_Liu/archive/2011/05/04/2012284.html 证明一个问题Q是NPC问题： 1. 证明Q是NP： 给出certificate，证明能在poly-time内examine这个certificate的正确性。 2....

2017/12/07 21:57
7
Algorithm - Network Flow复习

ford-fulkerson

2017/12/04 11:12
25
LeetCode - Edit Distance

Dynamic Programming

2017/11/27 14:03
2
LeetCode - Coin Change

Dynamic Programming

2017/11/27 05:50
35
LeetCode - Generate Parentheses

package GenerateParentheses; import java.util.ArrayList; /*  GIVEN: A Int represents the number of pairs of "(" and ")" we have. *   RETURNS: All possible VALID combinations of...

2017/11/11 00:10
17
LeetCode - LongestValidParentheses

package LongestValidParenthses; import java.util.Stack; /* * GIVEN: A string contains only "(" and ")" * RETURNS: A int represents the length of the longest continuous valid p...

2017/11/10 09:10
29