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...
分类:
其他好文 时间:
2014-10-06 14:52:50
阅读次数:
220
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
/**
* Definition for binary tree
* struct TreeNode {...
分类:
其他好文 时间:
2014-10-06 14:45:50
阅读次数:
178
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-10-06 13:11:00
阅读次数:
167
本文仅代表个人认知、观点、经验,May be Stupid!什么是PEPPEP是 Python Enhancement Proposal 的缩写,翻译过来就是 Python增强建议书 。PEP8译者:本文基于 2013-08-02 最后修改的 PEP8 版本翻译,若要查看英文原文,请参考PEP8简介...
分类:
其他好文 时间:
2014-10-06 02:47:09
阅读次数:
16236
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extr...
分类:
其他好文 时间:
2014-10-06 00:41:19
阅读次数:
271
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 binary tree, 1 ...
分类:
其他好文 时间:
2014-10-05 23:13:59
阅读次数:
166
构造数据: > dataset = matrix(c(1,2,
+ 1.2,2,
+ 8,9,
+ 0.9,1.8,
+ 7,10,
+ 8.8,9.2), nrow=6, byrow=T)
> dataset
[,1] [,2]
[1,] 1.0 2.0
[2,] 1.2 2.0
[3,] 8.0 9.0
[4,] 0.9 1.8
[5,] 7.0 1...
分类:
其他好文 时间:
2014-10-05 15:27:28
阅读次数:
373
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial...
分类:
其他好文 时间:
2014-10-05 13:53:58
阅读次数:
163
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...
分类:
其他好文 时间:
2014-10-05 04:01:47
阅读次数:
232
当用户应用new SparkContext后,集群就会为在Worker上分配executor,那么这个过程是什么呢?本文以Standalone的Cluster为例,详细的阐述这个过程。...
分类:
其他好文 时间:
2014-10-05 03:14:47
阅读次数:
258