Redian新闻
>
Canon L工厂要复工了,L镜头价格下降有望
avatar
Canon L工厂要复工了,L镜头价格下降有望# PhotoGear - 摄影器材
l*i
1
今天onsite,前三个面试官都是三哥。
被第二个三哥问晕了。问了我3道题。有一题是一个DP,白板写了。其他2个问题,跪了。
1.
问:无限数据流里,sample出k个。
答:reservoir sampling
问:解释一下这个算法
答:blabla
问:这个算法取每个数据的概率不一样,不可以
答:这是个经典算法,有paper证明过这个
问:好,那你现在证明一下这个算法
没研究过这个算法的证明,当场跪了。三哥坚持reservoir sampling是错误的。没办法
,我给了另外一个解法,每个data算一个random score,用heap保持score高的k个。
2.
问:给你一个binary tree,换成linked list
答:我问,是普通的binary tree? 不是BST?
问:就是最普通的任意binary tree
答:可以inorder走一遍,转换成linked list,返回inorder的第一个node作为list的
head
问:变成linked list后,怎么reconstruct回原来的binary tree。要求in place。
答:!#%&(,跪了,我觉得无解。
最后问三哥,怎么能reconstruct回去,三哥说,你多看看网上的题目,你会学到很多
知识。。。。!#%&(。。。
avatar
p*t
2
是不是original exhibit里的都不再重新打印?
但又看到有些版上经验说,IO不会去找以前的exhibit,重要的还得打。
大家给些建议。谢谢。
avatar
t*x
3
华盛顿州,15年 fixed rate.贷41万
谢谢
avatar
d*i
4
dang
avatar
g*e
5
1
可以用数学归纳法证明
2
binary tree serialize / deserialize leetcode有
avatar
w*i
6
无所谓,
我的353页

【在 p***t 的大作中提到】
: 是不是original exhibit里的都不再重新打印?
: 但又看到有些版上经验说,IO不会去找以前的exhibit,重要的还得打。
: 大家给些建议。谢谢。

avatar
h*7
7
你这是有cost refi? 怎么一点credit 没有啊?
avatar
b*b
8
低辐射镜片是不是对画质会有革命性的提高
avatar
l*i
9
第2题不是那个意思。inplace flatten变为linkedlist,再变回去。不是普通的BT的
serialize、deserialize

【在 g*********e 的大作中提到】
: 1
: 可以用数学归纳法证明
: 2
: binary tree serialize / deserialize leetcode有

avatar
u*0
10
My lawyer asked me not to repeat previously submitted material. So it
depends.

【在 w*****i 的大作中提到】
: 无所谓,
: 我的353页

avatar
s*i
11
没有好处的origination charge跟信用卡的annual fee差不多一个性质。
[发表自未名空间手机版 - m.mitbbs.com]
avatar
t*g
12
叫你们炒作,呵呵:)

【在 d******i 的大作中提到】
: dang
avatar
g*e
13

肯定是需要insert一些空node,三哥都叫你看网上题目了。也真赤裸裸 lol

【在 l****i 的大作中提到】
: 第2题不是那个意思。inplace flatten变为linkedlist,再变回去。不是普通的BT的
: serialize、deserialize

avatar
p*t
14
有时没办法呀
IO让提供journal的circulation information,但这些明明已经交过了。
不重新打,难道让IO去翻原来的exhibits。会不会IO觉得不爽?

【在 u********0 的大作中提到】
: My lawyer asked me not to repeat previously submitted material. So it
: depends.

avatar
y*n
15

should be purchase....

【在 h*********7 的大作中提到】
: 你这是有cost refi? 怎么一点credit 没有啊?
avatar
d*i
16
没准。以前有一款神镜(徕卡螺口 Summicron 50/2)不就是因为里面的某块玻璃有放
射性才风味独特的。

【在 b**b 的大作中提到】
: 低辐射镜片是不是对画质会有革命性的提高
avatar
l*i
17
这样不是inplace了。。。三哥要求constant space

【在 g*********e 的大作中提到】
:
: 肯定是需要insert一些空node,三哥都叫你看网上题目了。也真赤裸裸 lol

avatar
t*e
18
5290不应该收。再找一家。
avatar
b*b
19
看来用神镜也要够胆色啊
以前用过镧玻璃zeiss,这下有机会试试钚了

【在 d******i 的大作中提到】
: 没准。以前有一款神镜(徕卡螺口 Summicron 50/2)不就是因为里面的某块玻璃有放
: 射性才风味独特的。

avatar
S*1
20

了。
哥们不想在微软了?

【在 l****i 的大作中提到】
: 今天onsite,前三个面试官都是三哥。
: 被第二个三哥问晕了。问了我3道题。有一题是一个DP,白板写了。其他2个问题,跪了。
: 1.
: 问:无限数据流里,sample出k个。
: 答:reservoir sampling
: 问:解释一下这个算法
: 答:blabla
: 问:这个算法取每个数据的概率不一样,不可以
: 答:这是个经典算法,有paper证明过这个
: 问:好,那你现在证明一下这个算法

avatar
h*g
21
这是已经做了refi 了吧。怎么再找?
avatar
d*i
22
现在应该开工了吧
avatar
l*8
23
1。 数学归纳法
2. 刚才想了下,这样可否:
binary tree转换成linked list时,按level遍历, right child指针指向next。
left指针没用,可以指向parent.
这样就可以从"linked list"恢复binary tree了。

了。

【在 l****i 的大作中提到】
: 今天onsite,前三个面试官都是三哥。
: 被第二个三哥问晕了。问了我3道题。有一题是一个DP,白板写了。其他2个问题,跪了。
: 1.
: 问:无限数据流里,sample出k个。
: 答:reservoir sampling
: 问:解释一下这个算法
: 答:blabla
: 问:这个算法取每个数据的概率不一样,不可以
: 答:这是个经典算法,有paper证明过这个
: 问:好,那你现在证明一下这个算法

avatar
x*i
24
不都是no cost吗?

【在 h**g 的大作中提到】
: 这是已经做了refi 了吧。怎么再找?
avatar
Y*0
25
神医们赶快高位出货!
avatar
c*r
26
我今天也刚刚Onsite完,你面的什么组啊?
avatar
t*x
27
还没做,就是给个表让签字,感觉有些太贵了。
做refinance的说是没有cost, 不知道为啥还是这个表?
是不是现在3%,没有cost不算太糟糕?
如果她说没有cost应该哪一张纸看出来呢?
avatar
N*D
28
会有辐射
二手的会涨,

【在 d******i 的大作中提到】
: dang
avatar
i*n
29
第二题和我年初电面google的题目一样(也是印度人面的)
这个需要pass by reference。如果用C++做,就比较好做。如果用java,需要自定义一
个类,然后里面有一个成员变量带有node。下面的是我使用全局变量做的。
/**
Convert a binary tree
into a circular double linked list such that the linked list
elements are in the order of the in-order traversal result of the binary
tree.
**/
class Node{
int val;
Node left;
Node right;
}
public class BinaryTreeIntoDoubleLL{

/**
*
* return the head node of the converted double linked list
*
* @param rootNode
* @return
*/
public Node convertBinaryTreeIntoDoubleLL(Node rootNode){
if(rootNode == null){
return null;
}

visitAndConvert(rootNode);

/**
* now the rootNode becomes the middle node
*
* set the head and tail nodes
*/
Node head = rootNode;
Node tail = rootNode;
while(head.left != null) {
head = head.left;
}

while(tail.right != null) {
tail = tail.right;
}

head.left = tail;
tail.right = head;
return head;
}
/**
*
* global variable to keep the previously visited node
*
*/
Node prevVisitedNode = null;
private void visitAndConvert(Node node){

if(node == null){
return;
}

if(node.left != null){
visitAndConvert(node);
}

node.left = this.prevVisitedNode;
if(this.prevVisitedNode != null){
this.prevVisitedNode.right = node;
}

this.prevVisitedNode = node;

if(node.right != null){
visitAndConvert(node.right);
}
}

public static void main(String[] args){
BinaryTreeIntoDoubleLL sol = new BinaryTreeIntoDoubleLL();
Node rootNode = new Node();

sol.convertBinaryTreeIntoDoubleLL(rootNode);
}


}
avatar
h*g
30
别sign. 都是明确说 no point no fee 的。 不过没有留意在sign的contract 里哪一
条是具体到no point no fee的。
avatar
l*8
31
楼主还需要从linked list restore binary tree。 如果只是double linked list的话:
class BinaryTreeToLinkedList {
public:
TreeNode *head, *tail;
BinearyTreeToLinkedList(TreeNode *root) : head(NULL), tail(NULL) {
convert(root);
}
private:
convert(TreeNode *curr) {
if (!curr) return;
convert(curr->left);
if (tail)
tail->right = curr;
else
head = curr;
curr->left = tail;
tail = curr;
convert(curr->right);
}
};

【在 i*******n 的大作中提到】
: 第二题和我年初电面google的题目一样(也是印度人面的)
: 这个需要pass by reference。如果用C++做,就比较好做。如果用java,需要自定义一
: 个类,然后里面有一个成员变量带有node。下面的是我使用全局变量做的。
: /**
: Convert a binary tree
: into a circular double linked list such that the linked list
: elements are in the order of the in-order traversal result of the binary
: tree.
: **/
: class Node{

avatar
l*8
32
重新想了一下之前第二题的思路。 觉得应该转换成linked list的时候,应该用pre
order遍历。

【在 l*********8 的大作中提到】
: 1。 数学归纳法
: 2. 刚才想了下,这样可否:
: binary tree转换成linked list时,按level遍历, right child指针指向next。
: left指针没用,可以指向parent.
: 这样就可以从"linked list"恢复binary tree了。
:
: 了。

avatar
R*r
33
感觉yahoo要被三哥占领了,走在campus里一水阿三
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。