![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
sundawei2016
这个作者很懒,什么都没留下…
展开
-
简单的Boyer Moore Algorithm
Boyer Moore Algorithm是从最后一位向前开始查找。 如果 text 位置上的字母 没有出现在 patter 里的话就向右shift 一个pattern的长度 如果出现的话,就看情况 这样定义每个在 text 里的字母该 shift 的情况 for (int i = 0; i < k; i++) { table[pattern[i]] = k - i - 1;原创 2017-05-09 10:20:28 · 276 阅读 · 0 评论 -
Leetcode House Robber 系列总结
198. House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them原创 2017-06-21 19:45:48 · 242 阅读 · 0 评论 -
Preorder, Inorder, and Postorder tree Traversal Iterative solutions
Preorder Traversal: public List preorderTraversal(TreeNode root) { List result = new ArrayList<>(); Stack stack = new Stack<>(); TreeNode p = root; while(!stack.isEmpty() || p != null原创 2017-06-23 10:25:04 · 254 阅读 · 0 评论