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

随笔分类 -  OJ

摘要:LeetCode:Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You... 阅读全文
posted @ 2013-11-24 21:48 tenos 阅读(1486) 评论(2) 推荐(0) 编辑
摘要:LeetCode:Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by ... 阅读全文
posted @ 2013-11-24 21:37 tenos 阅读(3353) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST分析:... 阅读全文
posted @ 2013-11-24 15:30 tenos 阅读(1120) 评论(0) 推荐(1) 编辑
摘要:题目链接Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the d... 阅读全文
posted @ 2013-11-24 15:21 tenos 阅读(611) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from... 阅读全文
posted @ 2013-11-24 15:17 tenos 阅读(2954) 评论(2) 推荐(0) 编辑
摘要:LeetCode:Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals... 阅读全文
posted @ 2013-11-24 15:06 tenos 阅读(1758) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flatten... 阅读全文
posted @ 2013-11-24 14:57 tenos 阅读(576) 评论(0) 推荐(0) 编辑
摘要:我的LeetCode解题报告索引题目链接Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is ... 阅读全文
posted @ 2013-11-24 14:50 tenos 阅读(2677) 评论(1) 推荐(1) 编辑
摘要:LeetCode:Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; ... 阅读全文
posted @ 2013-11-22 14:24 tenos 阅读(1004) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1... 阅读全文
posted @ 2013-11-21 22:47 tenos 阅读(890) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the... 阅读全文
posted @ 2013-11-21 22:37 tenos 阅读(1750) 评论(0) 推荐(0) 编辑
摘要:LeetCode:Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted... 阅读全文
posted @ 2013-11-21 22:02 tenos 阅读(11570) 评论(5) 推荐(4) 编辑
摘要:题目如下: 二叉树的最大路径和(题目链接)Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below bin... 阅读全文
posted @ 2013-11-21 13:15 tenos 阅读(804) 评论(0) 推荐(0) 编辑
摘要:最近在准备找工作的算法题,刷刷LeetCode,以下是我的解题报告索引,每一题几乎都有详细的说明,供各位码农参考。根据我自己做的进度持续更新中...... 本文地址LeetCode:Reverse Words in a StringLeetCode:Evaluate Reverse Polish N... 阅读全文
posted @ 2013-11-20 23:09 tenos 阅读(9987) 评论(0) 推荐(0) 编辑
摘要:题目如下:(题目链接)Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ... 阅读全文
posted @ 2013-11-20 23:02 tenos 阅读(811) 评论(0) 推荐(0) 编辑
摘要:题目如下:(题目链接)Sort a linked list inO(nlogn) time using constant space complexity.在上一题中使用了插入排序,时间复杂度为O(n^2)。nlogn的排序有快速排序、归并排序、堆排序。双向链表用快排比较适合,堆排序也可以用于链表,... 阅读全文
posted @ 2013-11-20 22:54 tenos 阅读(6358) 评论(4) 推荐(1) 编辑
摘要:题目链接Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime comple... 阅读全文
posted @ 2013-11-13 22:34 tenos 阅读(478) 评论(0) 推荐(0) 编辑
摘要:题目链接 链表的插入排序Sort a linked list using insertion sort.建议:为了操作方便,添加一个额外的头结点。代码如下: 本文地址 1 /** 2 * Def... 阅读全文
posted @ 2013-11-13 22:13 tenos 阅读(2703) 评论(1) 推荐(0) 编辑
摘要:题目链接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 long... 阅读全文
posted @ 2013-11-13 21:38 tenos 阅读(1064) 评论(0) 推荐(0) 编辑
摘要:题目链接Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which... 阅读全文
posted @ 2013-11-13 16:44 tenos 阅读(674) 评论(0) 推荐(0) 编辑


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

公益页面-寻找遗失儿童