
Java & JDBC
文章平均质量分 76
xiaozhuaixifu
这个作者很懒,什么都没留下…
展开
-
【Union Find】JAVA implementation
import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.Scanner;class UF{ private int[] id; private int count; public UF(int N) { count = N; id = n原创 2014-05-03 16:32:16 · 1552 阅读 · 0 评论 -
【LeetCode】LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:get and set.get(key) - Get the value (will always be positive) of the key if t原创 2014-05-19 08:54:49 · 964 阅读 · 0 评论 -
【InversionCount 逆序对数 + MergeSort】
Definition of Inversion: Let (A[0], A[1] ... A[n], n A[j], then the pair (i, j) is called inversion of A.Example:Count(Inversion({3, 1, 2})) = Count({3, 1}, {3, 2}) = 2思路,如果用brute force,则O(n^2)原创 2014-04-26 22:02:10 · 1804 阅读 · 0 评论 -
【微软编程一小时】题目1 : Arithmetic Expression
时间限制:2000ms单点时限:200ms内存限制:256MB描述Given N arithmetic expressions, can you tell whose result is closest to 9?输入Line 1: N (1 Line 2..N+1: Each line contains an expression in the f原创 2014-04-28 18:54:25 · 1178 阅读 · 0 评论