anyone interested to discuss about the last question in ACM this year? <Tunnels
登录 | 论坛导航 -> 华新鲜事 -> 求学狮城 | 本帖共有 20 楼,当前显示第 9 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:房间 (等级:2 - 初出茅庐,发帖:21) 发表:2007-09-20 21:19:45  9楼  评分: 
这样可以么?for each node v perform a maximal flow between v and 0 to obtain the minimal cut (=mc); set the key of v to mc and insert it into a Fibonacci heap h; end while(true) v = h.extract_min(); (based on the key) remove v and all edges incident on v; if(node 1 is disconnected from node 0) return v.key; end end
顺带询问一个问题
是CLRS page 216 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.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 20 楼,当前显示第 9 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码