- 博客(8)
- 收藏
- 关注
原创 全组合
import java.util.ArrayList;import java.util.List;public class Solution { public List<List<Integer>> subsets(int[] nums) { List<List<Integer>> result = new ArrayList<>(); result.add(
2016-09-29 00:16:03 289
原创 组合 N选K
import java.util.ArrayList;import java.util.Arrays;import java.util.List;public class Solution { public void add(int[] array, int[] nums, List<List<Integer>> result) { List<Integer> list =
2016-09-28 23:51:45 389
原创 全排列 去重 非字典序
import java.util.ArrayList;import java.util.HashSet;import java.util.List;import java.util.Set;public class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>
2016-09-28 22:59:09 314
原创 01背包
import java.util.Scanner;public class Main { public static void main(String argv[]) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int n = in.nextInt();
2016-09-28 22:14:24 243
原创 全排列-字典序
import java.util.Scanner;public class Solution { static int count = 2; public static void swap(char[] arr, int i, int j) { char tmp = arr[i]; arr[i] = arr[j]; arr[j] = tm
2016-09-28 21:52:58 259
原创 旋转矩阵
import java.util.Arrays;public class Solution { //顺时针旋转90度 public void rotate(int[][] matrix) { for (int i = 0, j = matrix.length - 1; i < j; i++, j--) { int[] temp = matrix
2016-09-17 13:16:31 343
原创 小明看旗
import java.util.Scanner;public class Main{ public static boolean isForward(String line, String target1, String target2){ int pos = -1; pos = line.indexOf(target1); if(pos =
2016-09-11 11:37:19 657
原创 内存分配指令执行器
import java.util.ArrayList;import java.util.List;import java.util.Scanner;class Mem { int handle; int start; int count; public Mem(int handle, int start, int count) { this.hand
2016-09-11 11:22:21 312
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人