- 博客(6)
- 收藏
- 关注
原创 leetcode 二叉树的遍历栈的实现 Preorder Traversal Inorder Traversal Postorder Traversal
leetcode 二叉树的遍历用栈实现 非递归
2015-06-30 21:53:47 385
原创 leetcode Basic Calculator 栈
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and em
2015-06-30 19:31:03 287
原创 leetcode Add and Search Word - Data structure design回溯算法+Trie字典树
leetcode Add and Search Word - Data structure design回溯算法+Trie字典树
2015-06-28 11:03:14 467
原创 leetcode Generate Parentheses 回溯算法
题目:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(()
2015-06-26 22:04:35 684
原创 leetcode Combination Sum II回溯问题
最近一直在看回溯算法的框架,这道题代表性比较强,用到剪枝(重复1),和约束(超过界限直接return)。先贴下一般的回溯算法的框架。引用自这个bolg http://blog.jqian.net/post/backtracking.htmlvoid backtrack(int t){ if(t > n) output(x); else for (i
2015-06-26 10:06:46 317
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人