摘要: BFS 阅读全文
posted @ 2019-02-22 11:19 sourcry 阅读(104) 评论(0) 推荐(0)
摘要: ```c++ //BFS划分树的层 vector tree[maxn]; queue q; q.clear(); q.push(root); int cnt = 1; //统计如果队列的点的总数 int cmp = 0; //第cmp个访问的节点 int last = 1; //当前层数的最后一个节 阅读全文
posted @ 2019-02-22 11:16 sourcry 阅读(402) 评论(0) 推荐(0)