1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class preorder{

private List<TreeNode> list;
public List<TreeNode> inorder(TreeNode root){
if(root ==null){
return null;
}
inorder(root.left);
list.add(root);
inorder(root.right);
return list;

}

}

  tree

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×