由买买提看人间百态

topics

全部话题 - 话题: flatten
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
x*****0
发帖数: 452
1
Given a linked list where in addition to the next pointer, each node has a
child pointer, which may or may not point to a separate list. These child
lists may have one or more children of their own, and so on, to produce a
multilevel data structure, as shown in below figure.You are given the head
of the first level of the list. Flatten the list so that all the nodes
appear in a single-level linked list. You need to flatten the list in way
that all nodes at first level should come first, then nod... 阅读全帖
q********d
发帖数: 57
2
【 以下文字转载自 FleaMarket 讨论区 】
发信人: quellekind (quellekind), 信区: FleaMarket
标 题: [出售]REVLON DRIER/HAIR FLATTEN IRON/others-Moving Sale-NYC-QUEENS
发信站: BBS 未名空间站 (Fri Apr 30 14:16:13 2010, 美东)
二手交易风险自负!
YES
我想卖的物品:
REVLON DRIER
http://www.amazon.com/Revlon-RV544-Tourmaline-Lightweight-Silver/dp/B000FS05VG/ref=sr_1_1?ie=UTF8&s=beauty&qid=1272399036&sr=8-1
HAIR FLATTEN IRON
http://www.amazon.com/Andis-67690-Nano-Silver-Tourmaline-Ceramic/dp/B000U0C65C/ref=sr_1_1?ie=UTF8&s=beauty&qid=1272399653&sr=1-1
m**p
发帖数: 189
3
哪位大侠知道原因?

void flatten(TreeNode *root) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if (root==NULL) return;

TreeNode* curr = root;
while (curr) {
if (curr->left) {
TreeNode* temp = curr->left;
while (temp->right) {
temp = temp->right;
}
temp->right = curr->right;
curr->right = curr->left;
... 阅读全帖
a***e
发帖数: 413
4
这道题的iterative解法比较好懂,但看到下面这个recursive的就觉得想不清楚了。一
直对树的recursion挺糊涂的。怎么才能搞清楚呢?多谢!
class Solution {
public:
void flatten(TreeNode *root) {
helper(root, NULL);
}

TreeNode *helper(TreeNode *root, TreeNode *tail){
if (NULL==root) return tail;

root->right = helper(root->left, helper(root->right, tail));
root->left = NULL;
return root;
}
};
m*****k
发帖数: 731
5
http://www.programcreek.com/2013/01/leetcode-flatten-binary-tre
while condition 的 stack empty check 貌似是多余的,各位觉得呢?
F***Q
发帖数: 6599
6
来自主题: NextGeneration版 - 有妈妈了解flattening of head 吗?

also, increase tummy time helps too.
still, as the therapist told me, a flatten head is like a dented tin can,
once it starts, it gets progressively worse as the baby tends to sleep in
that position.
my baby's pedi told me his head will become rounded after year 2 even
without a helmet. I don't know if she meant to help, or just to make her
feel better for not warning me at the earlier checkups (as I mentioned this
before).
L****y
发帖数: 53
7
来自主题: Seattle版 - As of org flattening
" Anonymous said...
The Org flattening discussions have started in C+E. There will only be leads
and ICs. No M1/M2s. Test and dev Leads will be made into ICs. Some of the
DevManagers and test managers as well will be ICs. There will be no test
teams. Devs will own automation testing as well.
Thursday, July 17, 2014 10:19:00 PM"
If this is true:
1. A new engineering lead (or manager, whatever they are going to call it)
will have more IC directs.
2. All leads report to GM directly?
y****8
发帖数: 215
8
Faulty article. Flattening the curve is not a deadly delusion. Your title is
misleading. Curve flattening is inevitable and will happen, the question is
where and when will the curve flatten? Will it happen when it infects the 7
.7 billion people that exist on earth and there’s no one else to infect
further or hopefully much earlier than that. In reality linear exponential
regression curves never apply in the real world setting. Logistic
regressions are more applicable.
Flattening the curve is t... 阅读全帖
D********g
发帖数: 650
9
来自主题: JobHunting版 - [google面试]iterator访问
我的java 版本,欢迎指正
public static class Flattener {
final List> _vv;
int _curList = 0;
int _curOffset = 0;
public Flattener(final List> vv) {
if (vv == null) {
throw new IllegalArgumentException();
}
_vv = new ArrayList>();
for (int i = 0; i < vv.size(); ++i) {
if (vv.get(i) == null || vv.get(i).size() == 0) {
continue;
... 阅读全帖
x*****0
发帖数: 452
10
class Solution {
private:
TreeNode *pre;
public:
Solution() : pre(NULL) {}
void flatten(TreeNode *root) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
//static TreeNode* pre = NULL;
if (root != NULL) {
flatten(root->right);
flatten(root->left);
root->right = pre;
root->left = NULL;
pre = root;
}
}
};
各位帮我看看这段代码有什么问题?我自己测试leetcode给出的数据,没有问题。但是
就是过不了。
如果改... 阅读全帖
l*********8
发帖数: 4642
11
来自主题: JobHunting版 - 版上看到的几道F家的题目
我写一个linked list flatten和restore吧。 可能还有bugs
Node * flatten(Node * curr, Node * tail = NULL, Node * parent = NULL) {
if (!curr) return tail;

if (tail)
tail->next = current;
tail = current;
Node * next = curr->next;
if (curr->child)
tail = flatten(curr->child, tail, next ? curr : parent);
else if (!next)
curr->child = parent;
return flatten(next, tail, parent);
}
void restore(Node * curr) {
while (curr) {
Node * next = curr->next;
... 阅读全帖
b*******w
发帖数: 56
12
来自主题: JobHunting版 - g面经来一个。
type 'a elem = Single of 'a | Multi of ('a elem list);;
let rec flatten l =
match l with
| [] -> []
| hd :: tl -> match hd with
| Single x -> x :: flatten tl
| Multi x -> (flatten x) @ flatten tl;;

发帖数: 1
13
来自主题: JobHunting版 - 脸家电话面试面筋
第二道题是用inorder traversal, 但是有些tricky.
如果只是把元素值打印出来或者放入到list的话,就是个简单的inorder traversal.
但是这里是要把BST变成linked list。在遍历的时候要把tree node的left child变成
null, right child变为 next node of an in-order traversal.
刚开始我也写不出来,后来去看LC 114. Flatten Binary Tree to Linked List.
把那道题的最优解法改动了一下:
public class Solution {
private TreeNode pre = null;
private void flatten(TreeNode root){
if(root==null) return;
flatten(root.right);
root.right=pre;
pre=root;
TreeNode leftchild... 阅读全帖
h****y
发帖数: 77
14
Man Crushed by Steamroller On Orders of Chinese Officials
A villager in northern China attempting to resist a forced government
relocation by remaining on his land was brutally crushed to death by a road
flattening truck on the orders of a Chinese government official.
The story, which was censored in China’s state controlled media, has caused
outrage amongst users of Weibo, the Chinese version of Twitter, given it’s
horrifying similarity to what happened to student protesters who were
crushed to... 阅读全帖
C***S
发帖数: 1159
15
来自主题: Military版 - 看福克斯首页
美华们要注意了,现在我帝的抗疫策略已经出来了。昨天我们公司大会,还有专家们的
公开讲话都是一个意思:
we can't contain the epidemic, but we can have a mitigation plan. Wash your
hand and flatten the curve!
Flatten the curve是啥意思大家可以搜搜。所以现在我帝目标非常清楚了,就是希望
医院不爆,医院要想不爆,就要增加social distance。所以不必要的活动都没了,我
帝GDP80%的服务业,这么活半年来flatten the curve 的话,社会治安会怎么样,大家
想想。
d****o
发帖数: 32610
16
最近几天看到很多地方提到一个概念,
flatten the curve,
就是说把发病曲线扁平化,
峰值位置后移,避免医疗资源崩溃。
比如这样的:
这里量化讨论一下这个策略在我帝的可行性
暂时用最简单的SIR模型
SIR就是susceptible, infected, recoverd
系统如下:
参数:
人口3.27亿,
德国说可能感染70%,
我帝少算点假设30%最终感染好了,
其他人假设像老中一样关禁闭一个月不出门
初始感染人数:
保守一点,
假设现在我帝一万实际感染
beta可以从病例翻倍时间算,
Lancet说:COVID-19 had a doubling time in China of about 4–5 days in the
early phases
https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(20)30567-5/
fulltext
我帝现在病例基本三天翻倍,但这应该是检测的问题
这里用5天倍增时间来算
gamma可以从治疗需要的时间算,
The time from symptom... 阅读全帖
y****8
发帖数: 215
17
Hi Joscha,
if 40–70% get infected *and* 20% of those people will need intensive care,
we’re screwed. Flattening the curve is a smart idea under the assumption
that both the fatality rate and the percentage of people in need of
intensive care look very high at the moment because only a small part of the
population (let’s say almost all those who were not feeling well) have
been tested. Had everybody been tested, both percentages would be much lower
. So, the total number of people who will need i... 阅读全帖
d***1
发帖数: 14
18
很多留学生写论文完全被头疼的research左右,东抄西查,结果弄的论文面目全非,有
些同学抄到连最基本的概念都没有阐述。好的论文,应该在essay论文的开始部分,将
讨论的主要概念阐述清楚,这样确保论文可以不离题取得教授的正面评价直取更高的分
数。
1, 理解相关的概念。
很多留学生写论文完全被头疼的research左右,东抄西查,结果弄的论文面目全非,有
些同学抄到连最基本的概念都没有阐述。好的论文,应该在essay论文的开始部分,将
讨论的主要概念阐述清楚,这样确保论文可以不离题取得教授的正面评价直取更高的分
数。下面用Massey University的论文做个例子。
Discuss and analyse how intellectual capital might affect the implementation
and management of organizational KM and wider organizational structural and
processes.
这道题目的重点是在讨论”intellectual capital”,学生因此需要查书, ... 阅读全帖
d********w
发帖数: 363
19
来自主题: JobHunting版 - [google面试]iterator访问
给出一个二维vector,实现 flatten类
class flatten implements iterator{
public flatten(vector> a);
boolean hasNext();
iterator next();
}
可以用size求出所有的元素多少,但好像也不必,还要考虑到一些特殊case,比如里面
的vector大小为空。大家能写个bug free很简洁的么,谢谢
e******i
发帖数: 106
20
来自主题: JobHunting版 - 关于leetcode上的一道题
Hi leetcode上我有道题看不明白,求教各位大神。
是关于flatten binary tree to linkedlist那道。
我看到一个答案。
public class Solution {
03 public void flatten(TreeNode root) {
04 if(root==null)
05 return;
06
07 TreeNode curr=null;
08 Stack trees=new Stack();
09 trees.add(root);
10 while(!trees.empty())
11 {
12 TreeNode parent=trees.pop();
13
14 if(parent.right!=null)
15 {
16 ... 阅读全帖
m*****k
发帖数: 731
21
来自主题: JobHunting版 - 一道面试题。
一道店面
public class RatePeriod {
private Date startDate;
private Date endDate;
private Integer nightlyRate;
/* Assume getters, setters, hashCode, equals, toString have been impl’d
. */
}
/**
Returns a flattened list of rate periods where “flattened” means that any
overlaps have been resolved by favoring the greatest nightlyRate for the
duration of the overlap.
Example:
flatten [(2015-01-01, 2015-12-31, 125), (2015-03-07, 2015-03-21, 175)]
Output:
[(2015-01-01, 2015-03-06, 125),
(20... 阅读全帖
m*****k
发帖数: 731
22
来自主题: JobHunting版 - 新店面
一道店面
public class RatePeriod {
private Date startDate;
private Date endDate;
private Integer nightlyRate;
/* Assume getters, setters, hashCode, equals, toString have been impl’d
. */
}
/**
Returns a flattened list of rate periods where “flattened” means that any
overlaps have been resolved by favoring the greatest nightlyRate for the
duration of the overlap.
Example:
flatten [(2015-01-01, 2015-12-31, 125), (2015-03-07, 2015-03-21, 175)]
Output:
[(2015-01-01, 2015-03-06, 125),
(20... 阅读全帖
f********y
发帖数: 156
23
来自主题: JobHunting版 - LinkedIn Onsite 面经
貌似 tail->up -> down。其实up / down 可以交换,你在flatten的时候先处理谁,那
么在unflatten也要先处理它。

Deflatten的唯一是因为 up / down 指针在flatten以后还保留着。flatten 只是把上
下层的表头连到了当前层的尾巴。

Deflatten的时候,觉得应该BFS。 貌似分层的问题,染色的问题,都是BFS。( 楼主
原帖里的link 中有个递归做deflatten的函数,感觉不大对)
void deflatten(Node* pHead) {
if(! pHead ) {
return;
}

queue q;
q.push(pHead);

while(!q.empty()) {
Node* p = q.front();
q.pop();

while... 阅读全帖
o*q
发帖数: 630
24
来自主题: JobHunting版 - 请教leetcode高频题是哪些题
# Title Editorial Acceptance Difficulty Frequency
1
Two Sum 28.3% Easy
292
Nim Game 54.4% Easy
344
Reverse String 57.3% Easy
136
Single Number 52.2% Easy
2
Add Two Numbers 25.6% Medium
371
Sum of Two Integers 51.6% Easy
4
Median of Two Sorted Arrays
20.4% Hard
6
ZigZag Conversion 25.6% Easy
13
Roman to Integer 42.7% Easy
237
... 阅读全帖
a***c
发帖数: 578
25
来自主题: Running版 - Newton Running Motion Men's for $72
之前看到的一段关于neuroma的,把主要原因归到pronation上了
PRIMARY CAUSES
EXCESSIVE PRONATION
-Pronation is a normal movement of the foot, that allows the arch to flatten
to a degree, which helps the body to absorb shock and adapt to different
ground surfaces.
-In analyzing ones gait, first contact is on the heel and outside of the
foot; followed by a shift of body weight continuing forward, toward the arch
and toes.
-If the foot is weak or tired and/or the footwear is not supportive, then
the arch can flatten more t... 阅读全帖
b*********s
发帖数: 6757
26
来自主题: Tennis版 - 还是说拍子吧
转俱乐部的一帖:
网球包被盗,5个拍子没了。看来老天爷要我换拍子了。
__________________________________________
top choice:
1. Wilson 6.1 18x20
2. Head Youtek Graphene Speed Pro
3. Blade 98 18 x 20; Pacific X Force Pro 16x20
still want try
1. blade 98 16x19 with lead tape
___________________________________________
Head Youtek Graphene Speed Pro
-反手超好用, 特别是drive. DTL drive never felt this good...
-正手有些不适应,球容易下网, 也不是那么容易打深 (可能是18x20关系);感觉
full swing 时, 在击球前会忽然慢下来,但rotate手腕时accelerate 很快;不是那
么forgiving, 如果racquet head 没有drop, 球容易下... 阅读全帖
N****f
发帖数: 25759
27
来自主题: LeisureTime版 - [转载]小学课文的真相(ZT)
特来“和”龙兄一篇。
发信人: NWWoIf (西北の狈), 信区: LoveNLust
标 题: 考据者说
发信站: BBS 未名空间站 (Thu Feb 17 01:51:59 2011, 美东)
今天在买买提游山逛水,偶然看见有人说起一则奇文,题为《地震中的
父与子》,据说在国内流传甚广,而且堂而皇之进驻中小学语文课本。
其文曰:
“1989年发生在美国洛杉矶一带的大地震,在不到4分钟的时间里,使30
万人受到伤害。
在混乱和废墟中,一个年轻的父亲安顿好受伤的妻子,便
冲向他7岁儿子上学的学校。他眼前,那个昔日充满孩子们欢笑的漂亮的
三层教室楼,已变成一片废墟。

“他顿时感到眼前一片漆黑,大喊:‘阿曼达,我的儿子!’跪在地上大哭了
一阵后,他猛地想起自己常对儿子说的一句话:‘不论发生什么,我总会跟
你在一起!’他坚定地站起身,向那片废墟走去。”云云云云。(全文见
www.cnm21.com/Kultur/yywh_101.htm)
读未数行,疑窦丛生。话说1989年俺老正在洛杉矶一带坐镇,伤亡30万
人的大地震未报俺老批准竟敢发生,王法何在!加上文中的... 阅读全帖
k******g
发帖数: 132
28
来自主题: WaterWorld版 - Nile,你根本就看不懂文献。
nile连DSM-5的有关文献都看不懂,连bizarre delusions,nonbizarre delusions的定
义,什么叫逻辑混乱都没有弄明白,以及对逻辑混乱在妄想症和精神分裂症的诊断中的
意义也不清楚,还有什么能力争论妄想症诊断?
I,
nile对DSM-5定义的bizarre delusions,nonbizarre delusions的理解让人不知其所云。
nile对bizarre delusions,nonbizarre delusions的理解:
bizarre delusions就是nile所谓内在逻辑混乱:Delusions are deemed bizarre if
they are clearly implausible, not understandable, and not derived from
ordinary life experiences。注意这两个关键词:不合理implausible,不可理解not
understandable。
而non-bizarre delusions相当于nile所说的前提错误,如果接受前提为真,患者并没
有内在... 阅读全帖
k******g
发帖数: 132
29
你丫的连DSM-5的有关文献都看不懂,连bizarre delusions,nonbizarre delusions的定
义,什么叫逻辑混乱都没有弄明白,以及对逻辑混乱在妄想症和精神分裂症的诊断中的
意义也不清楚,还有什么能力争论妄想症诊断?
I,
nile对DSM-5定义的bizarre delusions,nonbizarre delusions的理解让人不知其所云。
nile对bizarre delusions,nonbizarre delusions的理解:
bizarre delusions就是nile所谓内在逻辑混乱:Delusions are deemed bizarre if
they are clearly implausible, not understandable, and not derived from
ordinary life experiences。注意这两个关键词:不合理implausible,不可理解not
understandable。
而non-bizarre delusions相当于nile所说的前提错误,如果接受前提为真,患者并没
有内在逻... 阅读全帖
N****f
发帖数: 546
30
来自主题: LoveNLust版 - 考据者说
今天在买买提游山逛水,偶然看见有人说起一则奇文,题为《地震中的
父与子》,据说在国内流传甚广,而且堂而皇之进驻中小学语文课本。
其文曰:
“1989年发生在美国洛杉矶一带的大地震,在不到4分钟的时间里,使30
万人受到伤害。
在混乱和废墟中,一个年轻的父亲安顿好受伤的妻子,便
冲向他7岁儿子上学的学校。他眼前,那个昔日充满孩子们欢笑的漂亮的
三层教室楼,已变成一片废墟。

“他顿时感到眼前一片漆黑,大喊:‘阿曼达,我的儿子!’跪在地上大哭了
一阵后,他猛地想起自己常对儿子说的一句话:‘不论发生什么,我总会跟
你在一起!’他坚定地站起身,向那片废墟走去。”云云云云。(全文见
www.cnm21.com/Kultur/yywh_101.htm)
读未数行,疑窦丛生。话说1989年俺老正在洛杉矶一带坐镇,伤亡30万
人的大地震未报俺老批准竟敢发生,王法何在!加上文中的儿子居然大号
“阿曼达”,不由得令人怀疑又是《知音》、《读者》一类地摊小报伪托之
作。信手Google一番,却赫然发现该文出自此间著名煽呼家Mark Victor
Hansen(不知为何被译为“马克·汉林... 阅读全帖
h****y
发帖数: 77
31
来自主题: ChinaNews版 - 直接压死。。。。。。。。
A villager in northern China attempting to resist a forced government
relocation by remaining on his land was brutally crushed to death by a road
flattening truck on the orders of a Chinese government official.
The story, which was censored in China’s state controlled media, has caused
outrage amongst users of Weibo, the Chinese version of Twitter, given it’s
horrifying similarity to what happened to student protesters who were
crushed to death by tanks during the Tiananmen Square protests in 19... 阅读全帖
p****s
发帖数: 3184
32
摘要:
In market economies, per capita GDP is directly proportional to the
population fraction with verbal IQ equal to or greater than 106.
We can make a pretty good guess. In all his versions, Man is the product of
adaptation to environments that existed more than 50,000 years ago. Africa,
Europe and Asia presented three distinct adaptational challenges resulting
in three major races: Negroid, Caucasoid and Mongoloid, each differing from
the other in certain physical, mental and psychological aspe... 阅读全帖
W*****B
发帖数: 4796
33
来自主题: Military版 - 很多被其它动物吃掉了
很多被其它动物吃掉了
Mystery meat: scientists are investigating the roadkill we never get to see
Thank goodness for scavenger animals.
That flattened raccoon or broken reptile might just be something to drive
past for motorists, but for scavenging animals, it’s breakfast. A new study
published today in the Journal of Urban Ecology is the first to look at the
role of these scavengers in performing roadkill removal—and its results
call into question whether we’re even counting roadkill right.
In the study, ... 阅读全帖
g*q
发帖数: 26623
34
日本很多地方都停课了。
新加坡天热,不一样的。
要让美国flatten the curve到群体免疫,每个月30万人感染也得1000个月


: 必然的。。。做好治疗工作就行了。。。现阶段停工不是为了消灭疫情,而是空
间换时

: 间,flatten the curve,等医疗条件许可之后,就会带毒复工。。。其实日本
新加坡

: 都没有停工,连课都没停。

D*****t
发帖数: 558
35
来自主题: Investment版 - bond fund 要处理掉么?
i have to admit i have zero confidence in my interest rate prediction. i
would argue that even if there were a mild yield curve flattening with the
short end going up more than the long end, one who holds short term bonds
would still lose less money than the long bond holders. and i really can't
see a severe and quick yield curve flattening or inverted yield curve. that
would be a harbinger of another upcoming recession.
generally i would say that bond market in the next decade won't be as
gener... 阅读全帖
k**********i
发帖数: 177
36
来自主题: JobHunting版 - Google店面
1个月前面的, 当时觉得还可以, 然后杯具了。。。就懒得发了。
两轮背靠背, 连着两个小时。
第一轮:
欧洲人做系统的,上来先介绍了下, 然后让我写c++的东西。。。
class Flattener{
public:
Flattener(const vector >& vv);
bool hasNext();
int next();
};
写完后提醒有bug, 没有考虑到vector是空的情况, 结果发现时间不够了, 就说了下。
后来有讨论下project的东西。
感觉一般
第二轮:
又是阿三, 上次youtube就被一个阿三折磨死了(听不懂,而且感觉他就不太想面,
面试晚了半个
小时, 唉)。 这次还好吧, 口音不重, 基本能听懂。
显示讨论下project, 然后做题, rotated array 的binary search, 准备过迅速搞
定,
然后有点儿typo, 我说改下, 他说没问题, 就继续讨论project了, 时间超过了45
分钟,他觉
d********g
发帖数: 10550
37
来自主题: JobHunting版 - 准备不好面试就是会悲剧
这么简单也挂,不应该啊。这题考点就两个,1是Python list内元素可以是任意对象的
概念,2是Python里赋值是传引用的概念
传引用这个,最常考的是交换a、b的值
只需要
a, b = b, a
即可。只要答上来保准面试官眼睛发亮
Python经常考的是一题多解,所谓Pythonic way(文艺解法)和传统(二逼)解法
比如一道binary tree遍历:
给一个tree和一个func,输出一个func过滤后的in-order list
二逼解法:recursion,可以在recursion过程中用func,也可以在最后用。和别的语言
没什么区别,不好看,不多说了
文艺解法:art_list = map(flatten(tree), func),然后flatten实现一个简单的in-
order遍历。这么做可以表明你对map/filter之类的掌握程度
Python的list comprehension也是常考的,偏技术的考官都期待你用文艺解法
不过遇到非技术的考官,你说太文艺了反而听不懂,那就尽量回答得二逼一点
d********g
发帖数: 10550
38
来自主题: JobHunting版 - 准备不好面试就是会悲剧
这么简单也挂,不应该啊。这题考点就两个,1是Python list内元素可以是任意对象的
概念,2是Python里赋值是传引用的概念
传引用这个,最常考的是交换a、b的值
只需要
a, b = b, a
即可。只要答上来保准面试官眼睛发亮
Python经常考的是一题多解,所谓Pythonic way(文艺解法)和传统(二逼)解法
比如一道binary tree遍历:
给一个tree和一个func,输出一个func过滤后的in-order list
二逼解法:recursion,可以在recursion过程中用func,也可以在最后用。和别的语言
没什么区别,不好看,不多说了
文艺解法:art_list = map(flatten(tree), func),然后flatten实现一个简单的in-
order遍历。这么做可以表明你对map/filter之类的掌握程度
Python的list comprehension也是常考的,偏技术的考官都期待你用文艺解法
不过遇到非技术的考官,你说太文艺了反而听不懂,那就尽量回答得二逼一点
j********x
发帖数: 2330
39
来自主题: JobHunting版 - 面经
PS1: 1. Merge sorted linked lists; 2. Iterative inorder traversal of
binary tree
PS2: 1. Inorder successor of binary search tree;
onsite: 1. infix expression evaluation of integers and + - * /; 2.
implement a system to route packets based on their priority; implement
associative container Map; 3. Given n nodes, each node has 2 blocking
functions: send(int to_id, int msg); recv(int from_id); each node has a
value; design a method to distribute the sum of all values on every node to
all nodes; 4. ... 阅读全帖
j********x
发帖数: 2330
40
来自主题: JobHunting版 - 面经
PS1: 1. Merge sorted linked lists; 2. Iterative inorder traversal of
binary tree
PS2: 1. Inorder successor of binary search tree;
onsite: 1. infix expression evaluation of integers and + - * /; 2.
implement a system to route packets based on their priority; implement
associative container Map; 3. Given n nodes, each node has 2 blocking
functions: send(int to_id, int msg); recv(int from_id); each node has a
value; design a method to distribute the sum of all values on every node to
all nodes; 4. ... 阅读全帖
f*******w
发帖数: 1243
41
背景:EE 非名校PhD 无线通信方向,预计夏天毕业,两次实习经历(12年Broadcom,
13年Amazon)
2月的时候发现时间紧迫,开始锁定SDE的目标狂投简历……真正意义上的海投,大大小
小有近百家吧,基本没有找人refer。偶尔在版上看到有人帮忙refer的时候也会问一下
,不过好像都被简历拒了- -
所有面经放上……
Bloomberg:
02/21 电面阿三,没有写具体code,都是说思路
Why bloomberg?
Mention and describe one of your projects. What is your role on this project?
Polymorphism in C++, how to implement virtual functions (vtable), different
types of polymorphisms (dynamic/static).
Two sum (with or without extra memory)
Kth node to the last (Linked List)
Implement m... 阅读全帖
s********e
发帖数: 340
42
来自主题: JobHunting版 - 收集了几个 List相关的题
LeetCode – Flatten Binary Tree to Linked List
http://www.programcreek.com/2013/01/leetcode-flatten-binary-tre
LeetCode Solution – Sort a linked list using insertion sort in Java
http://www.programcreek.com/2012/11/leetcode-solution-sort-a-li
leetcode -- Merge k Sorted Lists add code
http://www.cnblogs.com/feiling/p/3196546.html
Top 10 Algorithms for Coding Interview
http://www.programcreek.com/2012/11/top-10-algorithms-for-codin
s********e
发帖数: 340
43
来自主题: JobHunting版 - 收集了几个 List相关的题
LeetCode – Flatten Binary Tree to Linked List
http://www.programcreek.com/2013/01/leetcode-flatten-binary-tre
LeetCode Solution – Sort a linked list using insertion sort in Java
http://www.programcreek.com/2012/11/leetcode-solution-sort-a-li
leetcode -- Merge k Sorted Lists add code
http://www.cnblogs.com/feiling/p/3196546.html
Top 10 Algorithms for Coding Interview
http://www.programcreek.com/2012/11/top-10-algorithms-for-codin
t*****a
发帖数: 106
44
常年用C++,看到两道题要实现iterator
1. class flatten implements iterator{
public flatten(vector> a);
boolean hasNext();
iterator next();
}
2. "Program an iterator for a List which may include nodes or List i.e. *
{0,
{1,2}, 3 ,{4,{5, 6}}} Iterator returns 0 - 1 - 2 - 3 - 4 - 5 - 6"
第一题C++可以实现,第二题除非自己定义node structure,否则感觉无解。主要是C++
里的iterator不能赋NULL,看结束也不能用"iterator==NULL"来判断,得专门维持
collection结束的标识。感觉这种题是专
门给Java的人出的,C++没法搞,起码不能用已有的STL搞,非常坑人。不知道大家有什
么建议。
第一题的C++实现。
class Iterator
{
private:... 阅读全帖
d******a
发帖数: 238
45
题目 class flatten {
public flatten(vector> a);
boolean hasNext();
iterator next();
}
我不到20分钟写完了,25分钟跑完test cases还问面试官有bug没,他说没有。。过了
几天收到拒信。大家觉得这个是啥难度的题目? 20分钟写完不够快?
信大家看看写得有啥问题不?
I would say the the recruiters and the first interviewer were pretty good.
But I don't understand why I get rejection from the second interviewer. This
was actually the most wired interview I've had so far...
Let me explain my 2nd interview experience for a little bit. He gave me the
problem to solve on... 阅读全帖
k**0
发帖数: 19737
46
太长了,抓关键,写重点.
没必要写那么多code,HR不会看。
[在 duduhaha (starwithme) 的大作中提到:]
:题目 class flatten {
: public flatten(vector<vector<int>> a);
:...........
m******n
发帖数: 51
47
来自主题: JobHunting版 - LinkedIn Onsite 面经
看了之前大家的分享 大部分题都有命中 除了这题 分享给大家 之后面的人记得准备
题目跟这题类似
https://sites.google.com/site/spaceofjameschen/home/linked-list/flatten-and-
deflatten-doubly-linked
只是NEXT改成 上下(UP and Down)都可
class Node
{
int data;
Node Prev;
Node Next;
Node Up;
Node Down;
}
Another easier 类似题.
http://www.geeksforgeeks.org/flatten-a-linked-list-with-next-an
m******n
发帖数: 51
48
来自主题: JobHunting版 - LinkedIn Onsite 面经
It is a little bit similar to Leetcode
https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
but flatten a four-direction node graph to doubled linked list
and
1. No extra memory should be used
2. Node order doesn't matter
c*****m
发帖数: 271
49
来自主题: JobHunting版 - 报GF offer,分享一些面经
恭喜楼主,太牛逼!觉得题目大都是leetcode hard难度的啊。。。有如下几个问题问
下楼主
1、Coding flatten a list with left, right, up and down. Follow up, O(1)
space.
请问这题是不是http://www.geeksforgeeks.org/flattening-a-linked-list/的扩展呢?这里只有right和down,就是二维的情况。如果加上left,就是三维的情况了,二维解决了三维就能解决;同理加上up就是四维的,基于三维也能解决。不知道我的理解对不对
2、Given a board of characters and a dictionary, find the max number of
words on the board, each character can only be used once. 这里的character
can only be used once是对一个word还是所有的words呢?
3、L家的设计题看不懂,能不能指点下啊?二面中的output proced... 阅读全帖
o*q
发帖数: 630
50
来自主题: JobHunting版 - G家leetcode题
Google
Show problem tags Hide locked problems
#
Title
Acceptance
Difficulty
Frequency
66 Plus One 35.4% Easy
146 LRU Cache 15.8% Hard
200 Number of Islands 29.7% Medium
288 Unique Word Abbreviation 15.7% Easy
163 Missing Ranges 30.3% Medium
56 Merge Intervals 26.7% Hard
228 Summary Ranges 26.0% Medium
308 Range Sum Query 2D - Mutable 20.8% Hard
279 Perfect Squares 34.1% Medium
388 L... 阅读全帖
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)