本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss

随笔分类 -  OJ

摘要:题目链接Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.分析:一般一个题目我首先会想想怎么暴力解决,比如这一题,可... 阅读全文
posted @ 2013-12-02 23:23 tenos 阅读(3384) 评论(1) 推荐(2) 编辑
摘要:题目链接Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the ... 阅读全文
posted @ 2013-12-02 20:34 tenos 阅读(1377) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the o... 阅读全文
posted @ 2013-12-01 00:20 tenos 阅读(657) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representa... 阅读全文
posted @ 2013-12-01 00:15 tenos 阅读(1795) 评论(0) 推荐(1) 编辑
摘要:题目链接Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space to hold additional element... 阅读全文
posted @ 2013-11-30 23:43 tenos 阅读(621) 评论(0) 推荐(0) 编辑
摘要:题目链接The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total nu... 阅读全文
posted @ 2013-11-30 23:37 tenos 阅读(2498) 评论(0) 推荐(0) 编辑
摘要:题目链接A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message c... 阅读全文
posted @ 2013-11-30 23:19 tenos 阅读(1416) 评论(2) 推荐(0) 编辑
摘要:求集合的所有子集问题LeetCode:SubsetsGiven a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.Th... 阅读全文
posted @ 2013-11-30 23:01 tenos 阅读(10180) 评论(3) 推荐(4) 编辑
摘要:题目链接Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another exp... 阅读全文
posted @ 2013-11-28 22:42 tenos 阅读(3241) 评论(0) 推荐(0) 编辑
摘要:题目链接Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NUL... 阅读全文
posted @ 2013-11-28 22:25 tenos 阅读(568) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["2... 阅读全文
posted @ 2013-11-28 22:20 tenos 阅读(816) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there... 阅读全文
posted @ 2013-11-28 22:09 tenos 阅读(1713) 评论(0) 推荐(0) 编辑
摘要:题目链接Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.When... 阅读全文
posted @ 2013-11-28 21:14 tenos 阅读(685) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains on... 阅读全文
posted @ 2013-11-28 20:32 tenos 阅读(700) 评论(0) 推荐(0) 编辑
摘要:其他LeetCode题目欢迎访问:LeetCode结题报告索引题目链接Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.N... 阅读全文
posted @ 2013-11-27 14:51 tenos 阅读(3327) 评论(2) 推荐(0) 编辑
摘要:题目链接Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].... 阅读全文
posted @ 2013-11-27 13:21 tenos 阅读(1675) 评论(0) 推荐(0) 编辑
摘要:题目链接Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.分析:首先要注意的是,输入数组中可能有重复的点。由于两点确定一条直线,一个很直观的解法是计算每两个... 阅读全文
posted @ 2013-11-26 20:45 tenos 阅读(10095) 评论(8) 推荐(3) 编辑
摘要:其他LeetCode题目欢迎访问:LeetCode结题报告索引LeetCode:Word LadderGiven two words (startandend), and a dictionary, find the length of shortest transformation sequenc... 阅读全文
posted @ 2013-11-26 16:06 tenos 阅读(10697) 评论(5) 推荐(2) 编辑
摘要:题目链接Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica... 阅读全文
posted @ 2013-11-24 23:58 tenos 阅读(808) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 /... 阅读全文
posted @ 2013-11-24 23:40 tenos 阅读(1332) 评论(0) 推荐(0) 编辑


本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss

公益页面-寻找遗失儿童