xt
2 楼
本来要种东北大萝卜,结果下错了种子,出来了一
大片的四川红萝卜,好在味道不错,而且炒菜冷拼
都好吃,坏处是不能冬天储藏:
大片的四川红萝卜,好在味道不错,而且炒菜冷拼
都好吃,坏处是不能冬天储藏:
d*e
3 楼
【 以下文字转载自 JobHunting 讨论区 】
发信人: dilettante (半瓶醋), 信区: JobHunting
标 题: BST查找next lowest 可以达到 O(lg N)?
发信站: BBS 未名空间站 (Thu May 25 16:27:02 2017, 美东)
最近遇到next lowest的题,我写了下面这个inorder traversal (largest ->
smallest)的代码,但是对方坚持让我写 O(lg N),但是TreeNode 只有 left, right
pointer,没有parent pointer, 我觉得不可能啊,大牛有啥好办法吗?
public static Integer findNextLowest(TreeNode root, int target) {
Stack stack = new Stack<>();
TreeNode cur = root;
while (cur != null || stack.size() > 0) {
while (cur != null) {
stack.push(cur);
cur = cur.right;
}
TreeNode node = stack.pop();
if (node.val < target) return node.val; // found the next lowest
cur = node.left;
}
return null;
}
发信人: dilettante (半瓶醋), 信区: JobHunting
标 题: BST查找next lowest 可以达到 O(lg N)?
发信站: BBS 未名空间站 (Thu May 25 16:27:02 2017, 美东)
最近遇到next lowest的题,我写了下面这个inorder traversal (largest ->
smallest)的代码,但是对方坚持让我写 O(lg N),但是TreeNode 只有 left, right
pointer,没有parent pointer, 我觉得不可能啊,大牛有啥好办法吗?
public static Integer findNextLowest(TreeNode root, int target) {
Stack
TreeNode cur = root;
while (cur != null || stack.size() > 0) {
while (cur != null) {
stack.push(cur);
cur = cur.right;
}
TreeNode node = stack.pop();
if (node.val < target) return node.val; // found the next lowest
cur = node.left;
}
return null;
}
H*e
4 楼
random
b*n
5 楼
漂亮.
l*0
6 楼
Amortized O(log(n))?
m*o
7 楼
好像正常情况下485的处理是按RD,批准按PD
C*G
8 楼
胭脂萝卜真漂亮。做四川泡菜最好吃。
能排种子吗?
能排种子吗?
w*m
9 楼
把parent pointer放到argument里面吧
s*i
12 楼
private static TreeNode findNextLowest(TreeNode root, int target){
TreeNode node = root;
TreeNode res = null;
while(node != null){
while(node != null && node.val >= target){
node = node.left;
}
while(node != null && node.val < target){
res = node;
node = node.right;
}
}
return res;
}
TreeNode node = root;
TreeNode res = null;
while(node != null){
while(node != null && node.val >= target){
node = node.left;
}
while(node != null && node.val < target){
res = node;
node = node.right;
}
}
return res;
}
c*p
14 楼
这个做四川泡菜最好了!!!
N*n
15 楼
Define "next lowest". And what's this "root"? A sorted tree, a heap
or sth?
【在 d********e 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: dilettante (半瓶醋), 信区: JobHunting
: 标 题: BST查找next lowest 可以达到 O(lg N)?
: 发信站: BBS 未名空间站 (Thu May 25 16:27:02 2017, 美东)
: 最近遇到next lowest的题,我写了下面这个inorder traversal (largest ->
: smallest)的代码,但是对方坚持让我写 O(lg N),但是TreeNode 只有 left, right
: pointer,没有parent pointer, 我觉得不可能啊,大牛有啥好办法吗?
: public static Integer findNextLowest(TreeNode root, int target) {
: Stack stack = new Stack<>();
: TreeNode cur = root;
or sth?
【在 d********e 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: dilettante (半瓶醋), 信区: JobHunting
: 标 题: BST查找next lowest 可以达到 O(lg N)?
: 发信站: BBS 未名空间站 (Thu May 25 16:27:02 2017, 美东)
: 最近遇到next lowest的题,我写了下面这个inorder traversal (largest ->
: smallest)的代码,但是对方坚持让我写 O(lg N),但是TreeNode 只有 left, right
: pointer,没有parent pointer, 我觉得不可能啊,大牛有啥好办法吗?
: public static Integer findNextLowest(TreeNode root, int target) {
: Stack
: TreeNode cur = root;
n*s
16 楼
Imagine this:
USCIS sort cases into separate boxes by their PD. They group cases with PD
within 10 days together. So let's say there are three groups:
group1: PD1st-10th, group2: PD 11th-20th, and group3: PD21st-31st.
In each group, there are ten cases.
Now VB passed those dates and all the cases are current. Three IOs head to
boxes to pick up those cases. The first IO takes all ten cases in group1,
second IO takes all ten cases in group2, third takes group3.
They go back and started to approve each case. Each IO approves one case
each day. So the first day, cases with PD in 1st, 11th, and 21st got
approved. The second day, PD in 2nd, 12th, and 22nd got GCs. ...
Above is just for illustration. You get the picture.
USCIS sort cases into separate boxes by their PD. They group cases with PD
within 10 days together. So let's say there are three groups:
group1: PD1st-10th, group2: PD 11th-20th, and group3: PD21st-31st.
In each group, there are ten cases.
Now VB passed those dates and all the cases are current. Three IOs head to
boxes to pick up those cases. The first IO takes all ten cases in group1,
second IO takes all ten cases in group2, third takes group3.
They go back and started to approve each case. Each IO approves one case
each day. So the first day, cases with PD in 1st, 11th, and 21st got
approved. The second day, PD in 2nd, 12th, and 22nd got GCs. ...
Above is just for illustration. You get the picture.
n*s
18 楼
Now imagine this:
On day 6, first IO decides to take 5 days off. At day 10, all cases are
approved except PD6th-10th. At day 11, first IO comes back and there are no more visa numbers. PD6th-10th have to wait.
On day 6, first IO decides to take 5 days off. At day 10, all cases are
approved except PD6th-10th. At day 11, first IO comes back and there are no more visa numbers. PD6th-10th have to wait.
t*9
20 楼
I like your way of imagining the process flow.
Are you purely imagining or having some information which mentioned the
process flow?
I would not hold my breath for my approval. During my GC journey I find out
enjoying life and work do make my journey quicker.
no more visa numbers. PD6th-10th have to wait.
【在 n***s 的大作中提到】
: Now imagine this:
: On day 6, first IO decides to take 5 days off. At day 10, all cases are
: approved except PD6th-10th. At day 11, first IO comes back and there are no more visa numbers. PD6th-10th have to wait.
Are you purely imagining or having some information which mentioned the
process flow?
I would not hold my breath for my approval. During my GC journey I find out
enjoying life and work do make my journey quicker.
no more visa numbers. PD6th-10th have to wait.
【在 n***s 的大作中提到】
: Now imagine this:
: On day 6, first IO decides to take 5 days off. At day 10, all cases are
: approved except PD6th-10th. At day 11, first IO comes back and there are no more visa numbers. PD6th-10th have to wait.
n*s
22 楼
I generalized and simplified it from reading USCIS's documents that contain how they process 485 cases. No. not pure imagination. I would rather imagine to be a billionaire or a millionaire instead;-)
process flow?
out : enjoying life and work do make my journey quicker.
【在 t********9 的大作中提到】
: I like your way of imagining the process flow.
: Are you purely imagining or having some information which mentioned the
: process flow?
: I would not hold my breath for my approval. During my GC journey I find out
: enjoying life and work do make my journey quicker.
:
: no more visa numbers. PD6th-10th have to wait.
process flow?
out : enjoying life and work do make my journey quicker.
【在 t********9 的大作中提到】
: I like your way of imagining the process flow.
: Are you purely imagining or having some information which mentioned the
: process flow?
: I would not hold my breath for my approval. During my GC journey I find out
: enjoying life and work do make my journey quicker.
:
: no more visa numbers. PD6th-10th have to wait.
m*o
24 楼
看来是布朗运动的结果
L*1
25 楼
哎呀,很好啊
t*9
26 楼
Have you heard anything on your EAD/AP?
I think this is really the thing that helps.
My mom already asked my plan for Chinese New Year. You know what she means.
Haha.
contain how they process 485 cases. No. not pure imagination. I would rather
imagine to be a billionaire or a millionaire instead;-)
【在 n***s 的大作中提到】
: I generalized and simplified it from reading USCIS's documents that contain how they process 485 cases. No. not pure imagination. I would rather imagine to be a billionaire or a millionaire instead;-)
:
: process flow?
: out : enjoying life and work do make my journey quicker.
I think this is really the thing that helps.
My mom already asked my plan for Chinese New Year. You know what she means.
Haha.
contain how they process 485 cases. No. not pure imagination. I would rather
imagine to be a billionaire or a millionaire instead;-)
【在 n***s 的大作中提到】
: I generalized and simplified it from reading USCIS's documents that contain how they process 485 cases. No. not pure imagination. I would rather imagine to be a billionaire or a millionaire instead;-)
:
: process flow?
: out : enjoying life and work do make my journey quicker.
L*1
27 楼
埋在土里是不是可以存一段时间,我小时候冬天大人就是这样存萝卜的
n*s
28 楼
No. I don't have plan to go back until next summer. Winter break is too
short for my kid to travel far.
rather
【在 t********9 的大作中提到】
: Have you heard anything on your EAD/AP?
: I think this is really the thing that helps.
: My mom already asked my plan for Chinese New Year. You know what she means.
: Haha.
:
: contain how they process 485 cases. No. not pure imagination. I would rather
: imagine to be a billionaire or a millionaire instead;-)
short for my kid to travel far.
rather
【在 t********9 的大作中提到】
: Have you heard anything on your EAD/AP?
: I think this is really the thing that helps.
: My mom already asked my plan for Chinese New Year. You know what she means.
: Haha.
:
: contain how they process 485 cases. No. not pure imagination. I would rather
: imagine to be a billionaire or a millionaire instead;-)
b*y
34 楼
萝卜长得真好。MM是什么时候种的?长这么大需要多长时间?
相关阅读
实时应用在IOS, Android上那一个容易实现我老说说魏老师为啥扯谈吧这里大牛们都去黑客杯啊,大家最后看排名来决定谁NB?scala/clojure/groovy/Jython/jruby都是噱头这次Scala学Clojure有点不地道了来,魏老师来说说,这是不是你当年的事迹?1-2ms内反馈魏老师适合做点山寨的系统startup招2个人,在san josewell, a good architect don't need to be an expert on languaNOSQL排名魏老师拿出浑身解数zhaoce和goodbug的基本功问题各位是不是要关心一下?大家讨论一下C++模板吧 (转载)Goodbug这个人头重脚轻,嘴尖皮厚;不但学问浮夸,而且人品恶劣周末上点有用的信息有游戏app经验的来说说,这个数据大概靠谱吗?铁路订票网站不是技术问题大学里面14年下半年的学期要教streaming programmingCassandra vs Riak