Given a binary tree, write a method to find and return the sum of all nodes of the tree **iteratively**.

Example: 1 / \ 2 3 / \ / \ 4 5 6 7 / 8 ==> sum of all nodes = 36 (1+2+3+4+5+6+7+8)

Need a **hand?** Try out these hints, one at a time.

Use levelorder traversal to traverse the tree and increment a sum variable.

Use a

`Queue`

for levelorder traversal.
1. Declare a `Queue`

to store the `nodes`

of the tree.

2. Queue the `root`

.

3. Loop while the queue is not empty.

4. Within the loop, dequeue a node and add its data to the overall sum. Queue the **left** and **right** children.

5. Return the `sum`

outside the loop.

public int sumItr(TreeNode root) { }

**C**

**Java**

**Python**