[LeetCode] Binary Tree Inorder Traversal Solution

摘要: Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3,2].... 阅读全文
posted @ 2013-01-17 15:15 小刀初试 阅读(157) 评论(0) 推荐(0) 编辑

[LeetCode] Balanced Binary Tree Solution

摘要: 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 depth... 阅读全文
posted @ 2013-01-17 14:47 小刀初试 阅读(172) 评论(0) 推荐(0) 编辑

[LeetCode] Best Time to Buy and Sell Stock III Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2013-01-17 13:52 小刀初试 阅读(129) 评论(0) 推荐(0) 编辑

[LeetCode] Best Time to Buy and Sell Stock II Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2013-01-17 13:22 小刀初试 阅读(141) 评论(0) 推荐(0) 编辑

[LeetCode] Best Time to Buy and Sell Stock Solution

摘要: Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction ... 阅读全文
posted @ 2013-01-17 12:48 小刀初试 阅读(151) 评论(0) 推荐(0) 编辑
< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

统计

点击右上角即可分享
微信分享提示