Traverse a given binary tree in the Reverse Level Order. Mark a node as visited by adding its data to an

`ArrayList`

which will be returned.
Example: 1 / \ 2 3 / \ / \ 4 5 6 7 Output => 4567231

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

Reverse Levelorder Traversal : traverse the tree starting from the lowest level up. At each level, read the nodes from left to right.

Use a **Queue** to traverse through the nodes at each level and use a **Stack** to read the nodes in the reverse order.

1. If `root`

is `null`

, return.

2. Declare a `Queue`

and a `Stack`

.

3. Queue the `root`

.

4. Loop while the `Queue`

is not empty.

5. Within the loop, dequeue a node and insert its `left`

and `right`

nodes into the `Queue`

. At the same time, `push`

this element onto the `Stack`

.

6. Once the loop completes, `pop`

the `Stack`

's elements one by one and add them to the `ArrayList`

.

public ArrayList<Integer> levelorderRev(TreeNode root) { }

**C**

**Java**

**Python**