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是什么时候种的?长这么大需要多长时间?
相关阅读
Please help me prove SUM(logi) is Omega(nlogn) (转载)open an image fileLinux下运行lapack和blas的问题请问这道题怎么解决?C++读文件的一个基础问题Need experienced PHP Programmer urgently! Good pay!find command (转载)问个先后的问题good book on C/C++ programming under Linux/UNIX请教一个自动下载网页链接的问题C++ 和数据库结合的课, 哪个教材比较好啊?c++ template中如何判断类型TCP/IP面试题求教e-book: Oracle Essentials (O'Reilly)新移民找程序员工作容易吗???急问,有哪位面过微软SDET的大哥啊!能否帮一下小弟!ebook书籍下载除了emule还有什么好地方吗?如何将若干已升序排序好的数组合并在一起,并仍然是升序?Windows comand line extends the end like Unix "\" (转载)Priint .chm file (转载)