- 博客(12)
- 收藏
- 关注
原创 n划分为1,2,3等等(动态规划)
package bd_algo;import java.util.Scanner;public class coin { public static void main(String[] args) { Scanner in = new Scanner(System.in); int[] coins = {0, 1, 2, 3}; while
2017-08-29 17:06:07 586
原创 lintcode-二叉树中查找区间
/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this.left =
2017-08-31 16:18:13 351
原创 leetcode-最接近0的子数组和
public class Solution { /** * @param nums: A list of integers * @return: A list of integers includes the index of the first number * and the index of the last number *
2017-08-31 14:55:56 717
原创 lintcode-bitswap
package bd_algo;public class bit_tran { public static void main(String[] args) { System.out.println(bitSwapRequired(1, -1)); } public static int bitSwapRequired(int a, int b) {
2017-08-29 17:08:07 281
原创 lintcode括号匹配
package bd_algo;import java.util.HashMap;import java.util.Map;import java.util.Stack;/** * Created by Administrator on 2017/8/29. */public class bracketsMatch { public static void main(String[
2017-08-29 17:07:08 391
原创 lintcode-最后一个单词的长度
package bd_algo;import java.util.LinkedHashMap;/** * Created by Administrator on 2017/8/29. */public class LengthOfWord { public static void main(String[] args) { LinkedHashMap map = new
2017-08-29 17:04:41 231
原创 leetcode-lintcode-LRU缓存
package bd_algo;import java.util.LinkedHashMap;import java.util.Map;/** * Created by Administrator on 2017/8/29. */public class LRUCache { public static void main(String[] args) { } int
2017-08-29 17:03:51 233
原创 快排
package bd_algo;/** * Created by Administrator on 2017/8/28. */public class QS { public static void main(String[] args) { int[] nums = {3, 2, 1, 5, 4}; quickSort(nums); fo
2017-08-29 17:02:45 193
原创 lintcode-矩阵归零
package bd_algo;import java.util.ArrayList;/** * Created by Administrator on 2017/8/29. */class MyPoint { int x; int y; MyPoint(int x, int y) { this.x = x; this.y = y;
2017-08-29 17:00:51 267
原创 hihocoder1121
import java.util.*;enum Color{ no, white, black}class Node{ private Color color; private int id; List<Integer> dateIds = new ArrayList<>(); Node(int id){ this.id = i
2017-08-06 19:54:18 225
原创 hihocoder1066-并查集
package com.snnu;import java.util.HashMap;import java.util.Scanner;public class union_find { static int maxn = 100000; static int[] disjointSet = new int[maxn]; static int len; static
2017-08-02 16:40:04 238
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人