MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / Solution

Class Solution

TreeInorder.java:1–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Solution {
2 public void inorder(TreeNode node,List<Integer> list)
3 {
4 if(node==null) return;
5 inorder(node.left,list);
6 list.add(node.val);
7 inorder(node.right,list);
8 }
9 public List<Integer> inorderTraversal(TreeNode root) {
10 List<Integer> list = new ArrayList<Integer>();
11 inorder(root,list);
12 return list;
13 }
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected