Redian新闻
>
“天朝垮台前,利益集团已经丢尽了它的脸”后续zz
avatar
“天朝垮台前,利益集团已经丢尽了它的脸”后续zz# Joke - 肚皮舞运动
e*e
1
There is a binary tree(Not a BST) in which you are given three nodes x,y,z .
Write a function which finds whether y lies in the path b/w x
avatar
j*a
2
Cash Back两个选择有没有任何区别? (1) Statement Credit (2) Send check.
avatar
p*w
3
“天朝垮台前,利益集团已经丢尽了它的脸”后续zz
湖南《潇湘晨报》因在10月30日出版的“辛亥革命100年特刊”中,刊登了文章——《
天朝垮台前,利益集团已经丢尽了它的脸》,其总编辑刘剑被免职、执行总编辑龚晓跃
被调离内容部门。
据悉,是因为“有关部门”点名批评了《潇湘晨报》的“辛亥革命100年特刊”,报社
迫于压力,宣布对总编辑刘剑与执行总编辑龚晓跃进行处理。《潇湘晨报》将为此刊登
认错函。
avatar
m*1
4
inorder traversal?
avatar
c*4
5
没区别
前者省事,后者要deposit check而已

【在 j***a 的大作中提到】
: Cash Back两个选择有没有任何区别? (1) Statement Credit (2) Send check.
avatar
wy
6
zkss

【在 p*********w 的大作中提到】
: “天朝垮台前,利益集团已经丢尽了它的脸”后续zz
: 湖南《潇湘晨报》因在10月30日出版的“辛亥革命100年特刊”中,刊登了文章——《
: 天朝垮台前,利益集团已经丢尽了它的脸》,其总编辑刘剑被免职、执行总编辑龚晓跃
: 被调离内容部门。
: 据悉,是因为“有关部门”点名批评了《潇湘晨报》的“辛亥革命100年特刊”,报社
: 迫于压力,宣布对总编辑刘剑与执行总编辑龚晓跃进行处理。《潇湘晨报》将为此刊登
: 认错函。

avatar
j*u
7
easy if Node has a parent pointer
if not, do a recursive traversal and maintain a set that contains the nodes
from root to current, and check x,y,z in the set during traversal. If we eve
r see nodes get added into set following x->z->y or or y->z->x order, we kno
w z is on the path between x and y. Time: O(N), Space: O(logN)

.

【在 e*****e 的大作中提到】
: There is a binary tree(Not a BST) in which you are given three nodes x,y,z .
: Write a function which finds whether y lies in the path b/w x

avatar
k*e
8
难道天朝不是指大清,利益集团不是指满洲王公?

【在 p*********w 的大作中提到】
: “天朝垮台前,利益集团已经丢尽了它的脸”后续zz
: 湖南《潇湘晨报》因在10月30日出版的“辛亥革命100年特刊”中,刊登了文章——《
: 天朝垮台前,利益集团已经丢尽了它的脸》,其总编辑刘剑被免职、执行总编辑龚晓跃
: 被调离内容部门。
: 据悉,是因为“有关部门”点名批评了《潇湘晨报》的“辛亥革命100年特刊”,报社
: 迫于压力,宣布对总编辑刘剑与执行总编辑龚晓跃进行处理。《潇湘晨报》将为此刊登
: 认错函。

avatar
w*z
9
how about z is the parent of x and y, and x and y are in different subtrees

站: BBS 未名空间站 (Fri Feb 4 00:49:26 2011, 美东)
nodes
eve
kno
,z

【在 j*****u 的大作中提到】
: easy if Node has a parent pointer
: if not, do a recursive traversal and maintain a set that contains the nodes
: from root to current, and check x,y,z in the set during traversal. If we eve
: r see nodes get added into set following x->z->y or or y->z->x order, we kno
: w z is on the path between x and y. Time: O(N), Space: O(logN)
:
: .

avatar
c*7
10
要求贴原文。。。
avatar
j*u
11
Then I misunderstood the question, in this case
1. Get path from root -> x and root -> y
2. Get the lowest common ancestor w of x and y
3. Check if z is on x -> w or w -> y
Complexity is still the same

subtrees

【在 w*z 的大作中提到】
: how about z is the parent of x and y, and x and y are in different subtrees
:
: 站: BBS 未名空间站 (Fri Feb 4 00:49:26 2011, 美东)
: nodes
: eve
: kno
: ,z

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