由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - google inerview question (转载)
相关主题
What's the efficient way to merge two BST?how to implement binary tree efficiently?
some interview questions请问大家一个eclipse CDT的问题 (转载)
binary search tree和hash table,各在什么场合用的多啊?怎么efficiently实现next_combination?
Convert a binary tree to a BST... in place..问一道HIVE题 关于Efficiency
这个Binary Tree的题来看看随机数与概率
convert sorted array to binary search tree, 非递归怎么解?阅读Robert Sedgewick的"algorithms in C"的感受
linked list vs Binary tree请教双键的动态结构用什么数据结构比较好?
这个同学很神[合集] 微软的一个面试题
相关话题的讨论汇总
话题: inerview话题: question话题: level话题: order话题: binary
进入Programming版参与讨论
1 (共1页)
i***h
发帖数: 12655
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: chuncl (ray), 信区: JobHunting
标 题: google inerview question
发信站: BBS 未名空间站 (Thu Jul 17 12:03:08 2008)
Question: How do you put a Binary Search Tree in an array in a efficient manner?
=================================
while there is some guy say using two of in-order, pre-order or post order
would do the work, but i felt it is not the most efficient way.
we can just save it LEVEL by LEVEL in the array. since it is BST not just
binary tree, any comments?
thanks
====
X****r
发帖数: 3557
2
If all keys are unique, just pre-order should be sufficient...

manner?

【在 i***h 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: chuncl (ray), 信区: JobHunting
: 标 题: google inerview question
: 发信站: BBS 未名空间站 (Thu Jul 17 12:03:08 2008)
: Question: How do you put a Binary Search Tree in an array in a efficient manner?
: =================================
: while there is some guy say using two of in-order, pre-order or post order
: would do the work, but i felt it is not the most efficient way.
: we can just save it LEVEL by LEVEL in the array. since it is BST not just
: binary tree, any comments?

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] 微软的一个面试题这个Binary Tree的题来看看
请教算法题convert sorted array to binary search tree, 非递归怎么解?
请教算法题linked list vs Binary tree
请教大家一个问题 (转载)这个同学很神
What's the efficient way to merge two BST?how to implement binary tree efficiently?
some interview questions请问大家一个eclipse CDT的问题 (转载)
binary search tree和hash table,各在什么场合用的多啊?怎么efficiently实现next_combination?
Convert a binary tree to a BST... in place..问一道HIVE题 关于Efficiency
相关话题的讨论汇总
话题: inerview话题: question话题: level话题: order话题: binary