Lintcode
screaming
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Find a Peak Element
Find a peak element Given an array of integers. Find a peak element in it. An array element is peak if it is NOT smaller than its neighbors. For corner elements, we need to consider only one neig转载 2016-01-20 22:41:39 · 445 阅读 · 0 评论 -
K most frequent words from a file
The Most Efficient Way To Find Top K Frequent Words In A Big Word Sequence up vote46down votefavorite 34 Input: A positive integer K and a big text. The text can a转载 2016-06-18 15:50:49 · 1144 阅读 · 0 评论 -
ladder BFS
leetcode BFS 2015年3月7日 hrwhisper Leave a comment 649 views 本次题解包括: 126 Word Ladder II127 Word Ladder130 Surrounded Regions 127 Word Ladder Given two words (start and end), and a dict转载 2016-06-15 23:08:22 · 531 阅读 · 0 评论 -
word ladder - shortest path
单词变换距离 Word Ladder (图的最短路径) 2014-02-28 20:15 832人阅读 评论(0) 收藏 举报 分类: 算法基础(19) 图解法问题(13) 字符串问题(44) LeetCode(150) 版权声明: GNU General Public License. http://lucky转载 2016-06-15 12:27:07 · 453 阅读 · 0 评论 -
trapping water
LeetCode:Container With Most Water,Trapping Rain Water Container With Most Water 题目链接 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n转载 2016-06-12 07:06:02 · 337 阅读 · 0 评论 -
word ladder2
Word Ladder II 描述 Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: • Only one letter can be changed at a time转载 2016-06-11 23:28:34 · 608 阅读 · 0 评论 -
word ladder
链接:http://leetcode.com/onlinejudge#question_126 原题: Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only on转载 2016-06-11 23:27:26 · 476 阅读 · 0 评论 -
word ladder
leetcode之word ladder 标签: leetcode 2013-10-20 19:30 10736人阅读 评论(5) 收藏 举报 本文章已收录于: 算法与数据结构知识库 分类: leetcode(5) 版权声明:本文为博主原创文章,未经博主允许不得转载。 对于之前没有接触过该类型题目的人来说,此题无疑转载 2016-06-11 23:25:23 · 401 阅读 · 0 评论 -
word ladder
单词变换距离 Word Ladder (图的最短路径) 2014-02-28 20:15 830人阅读 评论(0) 收藏 举报 分类: 算法基础(19) 图解法问题(13) 字符串问题(44) LeetCode(150) 版权声明: GNU General Public License. http://lucky转载 2016-06-11 23:24:24 · 400 阅读 · 0 评论 -
word ladder
[leetcode]Word Ladder II @ Python [leetcode]Word Ladder II @ Python 原题地址:http://oj.leetcode.com/problems/word-ladder-ii/ 参考文献:http://blog.youkuaiyun.com/doc_sgl/article/details/13341405转载 2016-06-11 23:23:36 · 370 阅读 · 0 评论 -
longest continuous subsequence of 0s
How can we find the longest continuous subsequence of 0's in binary representation of an integer in O(log n) time complexity? Michal Forišek, teacher, scientist, c转载 2016-03-23 19:12:43 · 369 阅读 · 0 评论 -
Binary Tree Maximum Path Sum
Binary Tree Maximum Path Sum Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. 求树的一点到另一点的最大路径,利用递归的方法,ans 在 左子树,右子树,root+左+右的最大中产生。 /*转载 2016-02-25 14:10:19 · 266 阅读 · 0 评论 -
maximum subarray
最大子串和问题(Maximum Subarray) 标签: 算法 2011-10-10 16:46 14186人阅读 评论(11) 收藏 举报 版权声明:本文为博主原创文章,未经博主允许不得转载。 又一个经典问题,对于一个包含负值的数字串array[1...n],要找到他的一个子串array[i...j](0 这里我们需要注意子串和子序列之间的区别。子串是指转载 2016-03-18 22:00:01 · 252 阅读 · 0 评论 -
Minimum Depth of a Binary Tree
Find Minimum Depth of a Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from root node down to the nearest leaf node.转载 2016-03-03 21:31:01 · 327 阅读 · 0 评论 -
Level Order Tree Traversal
Level Order Tree Traversal Level order traversal of a tree is breadth first traversal for the tree. Example Tree Level order traversal of the above tree is 1 2 3 4 5 METHOD 1 (Use function转载 2016-03-02 14:23:35 · 530 阅读 · 0 评论 -
Find the Minimum Element in A sorted and Rotated Array
Find the minimum element in a sorted and rotated array A sorted array is rotated at some unknown point, find the minimum element in it. Following solution assumes that all elements are distin转载 2016-01-20 22:43:15 · 345 阅读 · 0 评论 -
python heapq
python heapq 这个模块(build-in)实现了一个堆的数据结构,完美的解决了Top-K问题,以后解决Top-K问题的时候,直接把这个模块拿来用就可以了 注意,默认的heap是一个小顶堆! heapq模块提供了如下几个函数: heapq.heappush(heap, item) 把item添加到heap中(heap是一个列表) heapq.he转载 2016-06-18 18:50:03 · 666 阅读 · 0 评论
分享