DFS+Backtracking
不刷脸皮要刷题
这个作者很懒,什么都没留下…
展开
-
Combination Sum I, II
public class Solution { public List> combinationSum(int[] candidates, int target) { if (candidates == null || candidates.length == 0) { return null; } Arrays.so转载 2014-11-11 23:48:00 · 230 阅读 · 0 评论 -
Letter Combinations of a Phone number
先把digit-letter建个 Given a digit string, return all possible letter combinations that the number could represent.转载 2014-11-12 00:06:30 · 307 阅读 · 0 评论 -
Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ]转载 2014-10-09 12:26:47 · 304 阅读 · 0 评论 -
Word Search
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.转载 2014-10-09 12:20:31 · 250 阅读 · 0 评论 -
Permutation I,II
还要有多典型的DFS + backtracking,之前写的乱七八糟凑出来的,后来用了这个si转载 2014-10-30 23:52:15 · 264 阅读 · 0 评论 -
Sudoku Solver
找到存在的解:DFS + Backtracking 因为ji转载 2014-10-13 00:12:31 · 254 阅读 · 0 评论 -
Subsets I, II
DFS + Backtracking II是考虑原set中有重复元素的情况 Subset I Subset I转载 2014-10-19 21:02:17 · 323 阅读 · 0 评论