1. 题目:Best Time to Buy and Sell Stock
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 (ie...
分类:
其他好文 时间:
2015-06-30 10:39:53
阅读次数:
125
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 complete as many transactions as you like (ie, buy one and...
分类:
其他好文 时间:
2015-06-30 10:32:15
阅读次数:
120
Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except...
分类:
其他好文 时间:
2015-06-25 13:43:02
阅读次数:
81
Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, exc...
分类:
其他好文 时间:
2015-06-25 12:18:57
阅读次数:
115
protected void onPostCreate (Bundle savedInstanceState)Added in API level 1Called when activity start-up is complete (after onStart() and onRestoreIns...
分类:
其他好文 时间:
2015-06-24 18:35:48
阅读次数:
165
Convert boolean values to strings 'Yes' or 'No'.Complete thebool_to_word(Javascript:boolToWord) method.Given: a boolean valueReturn: a 'Yes' string fo...
分类:
其他好文 时间:
2015-06-24 14:18:35
阅读次数:
171
AUTO-COMPLETE/AUTO-SUGGESTAuto-complete using VaadinOffer auto-suggest or auto-complete to help your users increase efficiency and reduce errors. You ...
分类:
移动开发 时间:
2015-06-23 07:35:34
阅读次数:
561
1. 问题描述 计算完全二叉树的节点数。对于完全二叉树的定义可参考wikipedia上面的内容。2. 方法与思路 最简单也最容易想到的方法就是使用递归,分别递归计算左右子树的节点数的和。但此方法最容易超时,一般不可取。
int countNodes(TreeNode* root) {
if(root == NULL) return 0;
else if(ro...
分类:
其他好文 时间:
2015-06-22 16:31:48
阅读次数:
417
Given a complete binary tree, count the number of nodes.
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completely filled,...
分类:
其他好文 时间:
2015-06-22 09:55:34
阅读次数:
149
题目:Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, exc...
分类:
编程语言 时间:
2015-06-19 11:45:05
阅读次数:
124