由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] 这个题有什么IDEA吗?
相关主题
merge two Binary search tree in O(n) time and O(1) spaceConvert a binary tree to a BST... in place..
一个关于关键字typename的问题这个Binary Tree的题来看看
算法问题,高手有请python, 怎么能把 tree存到 memory了 ?
今天逛jobhunting版说一道关于unbalanced树的面试题
linked list vs Binary treeRe: 请教一道题目
问一个简单的binary tree 问题请问这道题怎么解决?
请问如何才能对binary tree的题大小通吃?[合集] 一个链表倒转的问题
算法题一个BFS traversal starting from leaf level ???
相关话题的讨论汇总
话题: tree话题: idea话题: 题有话题: nodes话题: hint
进入Programming版参与讨论
1 (共1页)
c***d
发帖数: 996
1
☆─────────────────────────────────────☆
Pront (阿呆) 于 (Fri Nov 3 17:45:08 2006) 提到:
JOBHUNTING看来的,感觉 O(N)不太够啊。如果是任意两点,要预先保存两点关系的话
,似乎需要 O(N Lg N):
15. find out whether 2 tree nodes are related (i.e. ancestor-descendant)
requirement: solve it in O(1) time, with O(N) space (there are N nodes in
the tree), pre-processing is allowed
hint: traverse the tree twice, in normal order and in reverse-order
hint: traverse the tree once is also possible
☆─────────────────────────────────────☆
pxu (Li
1 (共1页)
进入Programming版参与讨论
相关主题
BFS traversal starting from leaf level ???linked list vs Binary tree
C++如何实现graph?问一个简单的binary tree 问题
请问bloomberg那个题有题库么?请问如何才能对binary tree的题大小通吃?
有人set up过 多个node的Cassandra 么? (转载)算法题一个
merge two Binary search tree in O(n) time and O(1) spaceConvert a binary tree to a BST... in place..
一个关于关键字typename的问题这个Binary Tree的题来看看
算法问题,高手有请python, 怎么能把 tree存到 memory了 ?
今天逛jobhunting版说一道关于unbalanced树的面试题
相关话题的讨论汇总
话题: tree话题: idea话题: 题有话题: nodes话题: hint