algorithm-design
文章平均质量分 55
Tongust
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
One-by-one to solve the Sequence Problem (1)
One-by-one to solve the Sequence Problem (1)1400 : Composition (from hihocoder)时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Alice writes an English composition with a length of N characters. However, her原创 2017-03-31 15:04:22 · 293 阅读 · 0 评论 -
Leetcode-DSF-Scramble String
思路ProblemCode思路此题有两难。 其一规律很难找寻,寻找scramble string 之间的关系需要敏锐的眼光。 没有快捷的算法,stack, DP, DC等等行不通,需尝试最傻的方法DSF。 ProblemGiven a string s1, we may represent it as a binary tree by partitioning it to t原创 2017-05-12 11:02:28 · 402 阅读 · 0 评论 -
Leetcode-2D Dynamic Programming
97. Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: s1 = “aabcc”, s2 = “dbbca”, When s3 = “aadbbcbcac”, return true. When原创 2017-05-04 00:45:34 · 327 阅读 · 0 评论 -
Leetcode-Reverse words in string
Given an input string, reverse the string word by word.For example, Given s = “the sky is blue”, return “blue is sky the”.Update (2015-02-12): For C programmers: Try to solve it in-place in O(1) s原创 2017-05-03 23:45:40 · 302 阅读 · 0 评论 -
Leetcode-Methodology-Preprocessing
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain duplic原创 2017-04-21 14:26:16 · 239 阅读 · 0 评论 -
Leetcode-Hash-List(2)
Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the原创 2017-04-21 01:37:38 · 241 阅读 · 0 评论 -
Leetcode-List-Hash
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the k原创 2017-04-20 23:16:18 · 271 阅读 · 0 评论 -
Leetcode-Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note: A solution using O(n) space is pretty straight forward. Could you devise a const原创 2017-05-03 10:41:55 · 255 阅读 · 0 评论 -
Leetcode-DSF-Trie-Backtrack
Word Search IIGiven 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原创 2017-04-20 14:49:50 · 256 阅读 · 0 评论 -
Leetcode-Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, 3, 4].原创 2017-04-20 01:00:49 · 217 阅读 · 0 评论 -
Leetcode-Trie
Add and Search Word - Data structure designDesign a data structure that supports the following two operations:void addWord(word) bool search(word) search(word) can search a literal word or a regular原创 2017-04-20 00:35:31 · 290 阅读 · 0 评论 -
One-by-one to solve the Sequence Problem (2)
#1399 : Shortening Sequence (from hihocoder) Stack时间限制:10000ms 单点时限:1000ms 内存限制:256MB描述There is an integer array A1, A2 …AN. Each round you may choose two adjacent integers. If their sum is an odd nu原创 2017-03-31 15:13:19 · 259 阅读 · 0 评论 -
Leetcode-Graph-Hash
133. Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization: Nodes are labeled uniquely.We use # as a separator f原创 2017-04-25 19:54:22 · 391 阅读 · 0 评论
分享