Given a binary tree, write a method to populate the list

`Arraylist <Integer> postorderedList`

with the nodes of the tree in postorder, recursively.
Example: 1 / \ 2 3 ==> 4526731 / \ / \ 4 5 6 7

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

Post-order traversal

1. Traverse the

2. Traverse the

3. Add the

1. Traverse the

`left`

subtree by recursively calling the postorder function. 2. Traverse the

`right`

subtree by recursively calling the postorder function.3. Add the

`data`

part of root element(or current element) in the arraylist
Use

`add`

method to add the node's data in the postorderedList list
1. Starting with the root node, recurse through the `left nodes`

. Data of the elements in the left subtree will get added to the ArrayList.

2. Recurse through the `right nodes`

. Data of the elements in the right subtree will get added next into the ArrayList.

3. Add the data of the `root nodes`

in the Array List then return from the method

//Populate the elements of the tree in the below list in the post order way. ArrayList<Integer> postOrderedList = new ArrayList<Integer>(); public void postorder(TreeNode root) { }

**C**

**Java**

**Python**