- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 Word Search II 题解
题目:Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those hori
2016-02-10 15:34:19 566 1
原创 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 horizontally or vertically
2016-02-10 14:26:53 586
原创 Combination Sum III 题解
题目:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Ensure that numbers with
2016-02-10 13:57:45 405
原创 Combination Sum II 题解
题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combinatio
2016-02-06 18:18:51 474
原创 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 to the n-queens puzzle.Each sol
2016-02-06 00:26:46 810
原创 N-Queens II 经典问题:8皇后问题 题解
题目上一篇我们使用了回溯法,然而提到回溯法就不得不提一个1848年提出的经典题目:8皇后问题,这个问题描述非常简单,一个8*8的棋盘上,放置8个皇后,使得每个皇后都不行相互攻击,既每个皇后的所在行、所在列、所在斜线上都不能有其他皇后,问有多少种解法,题目初看非常像图论问题,实际上也确实是,对图论感兴趣的同学可以去看离散数学的相关内容,这里我们用一种更巧妙也更直观的方法来解决这个问题,那就是——回溯法
2016-02-06 00:15:24 2794
原创 Combination Sum题解
题干: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited number
2016-02-01 22:46:21 486
原创 4 sum题解(K sum)
题干: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: Elements in a
2016-02-01 21:30:37 791
原创 Implement Trie (Prefix Tree)
这里没有按照顺序更新,首先是因为做过了很多题,但是回头看看有些题解还是忘了,写博客是为了回顾,并且当初做题的时候有些题目自己不是很懂,网上找的要么乱七八糟要么是纯英文或者纯代码,看起来很费劲,所以想自己整理一下,也帮助后来者少走一些弯路 这道题是自己实现一个数据结构:trie,字典树,或者叫前缀树,很重要,并且在非中文的信息检索中应用广泛,但是大学期间却没有讲过,更不要提实现,而且可能很多同学跟我
2016-02-01 00:27:12 474
现代操作系统中文第三版
2015-11-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人