Definition at line 18 of file main.cpp.
◆ invertTree()
Definition at line 21 of file main.cpp.
22 {
23 if (root == nullptr)
24 return nullptr;
25 queue<TreeNode*> q;
26 q.push(root);
27 while (!q.empty())
28 {
30 q.pop();
35 q.push(current->
left);
37 q.push(current->
right);
38 }
39 return root;
40 }
Definition for a binary tree node.
References TreeNode::left, and TreeNode::right.
The documentation for this class was generated from the following file: