摘要:
http://ac.jobdu.com/problem.php?pid=1520题目描述:输入两颗二叉树A,B,判断B是不是A的子结构。先建树,为了后面匹配时提高速度,每个结点做一个索引然后枚举A中的结点是否与B的树根相同,若相同,则遍历B的同时遍历A,判断是否相似#includestruct Tree{ int v; Tree *left,*right;}* Atree_p[1099],* Btree_p[1099];int n,m;int nodeL,nodeR;void build(Tree *thead,int num,int v){ thead->v=v; i... 阅读全文
posted @ 2013-10-23 21:43 huhuuu 阅读(706) 评论(0) 推荐(0)
浙公网安备 33010602011771号