bfs
二叉树的镜像
http://www.nowcoder.com/questionTerminal/a9d0ecbacef9410ca97463e4a5c83be7
TreeNode* Mirror(TreeNode* pRoot) { // write code here if(!pRoot) return nullptr; queue<TreeNode*> q; q.push(pRoot); while(!q.empty()) { int s = q.size(); for(int i=0;i<s;i++) { TreeNode* l = q.front()->left; TreeNode* r = q.front()->right; if(l) q.push(l); if(r) q.push(r); q.front()->right = l; q.front()->left = r; q.pop(); } } return pRoot; }