随笔分类 -  leetcode

摘要:1.题目描述 Given two binary trees, write a function to check if they are equal or not. Two binary trees are considere... 阅读全文
posted @ 2013-08-15 21:41 曾见绝美的阳光 阅读(288) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example... 阅读全文
posted @ 2013-08-15 20:59 曾见绝美的阳光 阅读(241) 评论(0) 推荐(0)
摘要:1.题目描述 Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may ass... 阅读全文
posted @ 2013-08-15 01:02 曾见绝美的阳光 阅读(220) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from lea... 阅读全文
posted @ 2013-08-15 00:30 曾见绝美的阳光 阅读(225) 评论(0) 推荐(0)
摘要:1.题目描述 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 2.解法分析 ... 阅读全文
posted @ 2013-08-15 00:02 曾见绝美的阳光 阅读(223) 评论(0) 推荐(0)
摘要:1.题目描述 Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. ... 阅读全文
posted @ 2013-08-14 23:35 曾见绝美的阳光 阅读(439) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree i... 阅读全文
posted @ 2013-08-13 21:35 曾见绝美的阳光 阅读(203) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest p... 阅读全文
posted @ 2013-08-13 21:04 曾见绝美的阳光 阅读(186) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For... 阅读全文
posted @ 2013-08-13 20:29 曾见绝美的阳光 阅读(213) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree, flatten it to a linked list in-place. For example, Given ... 阅读全文
posted @ 2013-08-13 15:12 曾见绝美的阳光 阅读(300) 评论(0) 推荐(0)
摘要:1.题目描述Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, & 阅读全文
posted @ 2013-08-13 13:25 曾见绝美的阳光 阅读(377) 评论(0) 推荐(0)
摘要:1.题目描述 Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any b... 阅读全文
posted @ 2013-08-12 14:39 曾见绝美的阳光 阅读(498) 评论(0) 推荐(0)
摘要:1.题目描述 Given a binary tree struct TreeLinkNode { TreeLinkNode *left; ... 阅读全文
posted @ 2013-08-12 13:07 曾见绝美的阳光 阅读(263) 评论(0) 推荐(0)
摘要:1.题目描述 Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Retu... 阅读全文
posted @ 2013-08-11 13:24 曾见绝美的阳光 阅读(195) 评论(0) 推荐(0)
摘要:1.题目描述 Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return ... 阅读全文
posted @ 2013-08-11 12:52 曾见绝美的阳光 阅读(236) 评论(0) 推荐(0)
摘要:1.题目描述 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. ... 阅读全文
posted @ 2013-08-11 12:38 曾见绝美的阳光 阅读(351) 评论(0) 推荐(0)
摘要:1.题目描述 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorith... 阅读全文
posted @ 2013-08-10 16:38 曾见绝美的阳光 阅读(290) 评论(0) 推荐(0)
摘要:1.题目描述: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorit... 阅读全文
posted @ 2013-08-10 14:26 曾见绝美的阳光 阅读(268) 评论(0) 推荐(0)
摘要:1.题目描述 Say you have an array for which the ith element is the price of a given stock on day i. If you were only p... 阅读全文
posted @ 2013-08-10 13:32 曾见绝美的阳光 阅读(237) 评论(0) 推荐(0)
摘要:1.题目说明 Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ... 阅读全文
posted @ 2013-08-09 23:11 曾见绝美的阳光 阅读(296) 评论(0) 推荐(0)