由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 这道题怎么做
相关主题
nonrecursive in-order traversal w/o stack?How to find the kth biggest number in a BST
一朋友被Google的电面干掉了 (转载)这个找successor in BST 比careercup上的好很多!
BT/BST做题心得Zillow screen 面经,兼打听工资
这道题有意思,求解法google phone interview
请教这道题有没有比较efficient的方法报google offer,和一些总结回报本版
Amazon onsite面经保持状态一天至少要做几题?
Fail的Google面经回馈本版5个不成功的onsite经历
算法问题,m*m matrix问个二叉树删除结点的问题
相关话题的讨论汇总
话题: tree话题: clrs话题: modify话题: space话题: procedure
进入JobHunting版参与讨论
1 (共1页)
m*****f
发帖数: 1243
1
CLRS 10.4.5
Write an O(n)-time nonrecursive procedure that, given an n-node binary tree,
prints out the key of each node. Use no more than constant extra space
outside of the tree itself and do not modify the tree, even temporarily,
during the procedure.
no recursive...O(1) space...cannot modify tree...
d*******n
发帖数: 141
2
O(1)space咋弄呢……逐层遍历可以不递归

tree,

【在 m*****f 的大作中提到】
: CLRS 10.4.5
: Write an O(n)-time nonrecursive procedure that, given an n-node binary tree,
: prints out the key of each node. Use no more than constant extra space
: outside of the tree itself and do not modify the tree, even temporarily,
: during the procedure.
: no recursive...O(1) space...cannot modify tree...

H*M
发帖数: 1268
3
use parent pointer
BST in CLRS usually has parent pointer
otherwise i dont think it is possible

tree,

【在 m*****f 的大作中提到】
: CLRS 10.4.5
: Write an O(n)-time nonrecursive procedure that, given an n-node binary tree,
: prints out the key of each node. Use no more than constant extra space
: outside of the tree itself and do not modify the tree, even temporarily,
: during the procedure.
: no recursive...O(1) space...cannot modify tree...

1 (共1页)
进入JobHunting版参与讨论
相关主题
问个二叉树删除结点的问题请教这道题有没有比较efficient的方法
A家面积Amazon onsite面经
请问怎样写没有parent pointer的BST iterator?Fail的Google面经回馈本版
分享一些自己面过的面筋算法问题,m*m matrix
nonrecursive in-order traversal w/o stack?How to find the kth biggest number in a BST
一朋友被Google的电面干掉了 (转载)这个找successor in BST 比careercup上的好很多!
BT/BST做题心得Zillow screen 面经,兼打听工资
这道题有意思,求解法google phone interview
相关话题的讨论汇总
话题: tree话题: clrs话题: modify话题: space话题: procedure