摘要: Binary Tree Inorder TraversalAug 27 '12Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3 return[1,3,2].Note:Recursive solution is trivial, could you do it iteratively?confused what"{1,#,2,3}"means?> read more o 阅读全文
posted @ 2013-01-29 13:28 西施豆腐渣 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IIINov 7 '12Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete at mosttwotransactions.Note:You may not engage in multiple transactions at the same time (ie, you must 阅读全文
posted @ 2013-01-29 08:53 西施豆腐渣 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IIOct 31 '12Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). However, 阅读全文
posted @ 2013-01-29 06:15 西施豆腐渣 阅读(152) 评论(0) 推荐(0) 编辑