
Backtracking
文章平均质量分 78
jialuyyy
这个作者很懒,什么都没留下…
展开
-
Gray Code
Gray Code The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, pri原创 2015-05-28 07:36:52 · 184 阅读 · 0 评论 -
Combinations Related
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: [[1,2] [1,3] [1,4] [2,3] [2,4] [3,4]]原创 2015-05-28 07:42:45 · 206 阅读 · 0 评论 -
Subsets
Subsets Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.原创 2015-05-28 10:09:27 · 202 阅读 · 0 评论 -
Subsets2
Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order.The solution set must not contain du原创 2015-05-28 10:13:42 · 197 阅读 · 0 评论 -
Word Search
Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizonta原创 2015-06-21 22:35:05 · 224 阅读 · 0 评论 -
N-Queens
N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions原创 2015-07-01 02:28:18 · 196 阅读 · 0 评论 -
N-Queens II
N-Queens II Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. Please refer to the N-queens. public原创 2015-07-01 02:53:50 · 172 阅读 · 0 评论 -
Permutations
Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. public clas原创 2015-05-28 10:20:34 · 182 阅读 · 0 评论