Redian新闻
>
Build binary search tree using level first traversal output
avatar
Build binary search tree using level first traversal output# JobHunting - 待字闺中
d*h
1
Dear Colleagues,
I want to ask an algorithm question:
Given a vector of int, which is the output of level first traversal of a
binary search tree, build the original BST. O(n) time complexity is required.
Thanks,
dbtouch
avatar
c*4
2
question, how the vector represent level like this:
1
\
4
/\
2 6
\
3

required.

【在 d*****h 的大作中提到】
: Dear Colleagues,
: I want to ask an algorithm question:
: Given a vector of int, which is the output of level first traversal of a
: binary search tree, build the original BST. O(n) time complexity is required.
: Thanks,
: dbtouch

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