public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> result = new ArrayList<Integer>();
        Stack<TreeNode> stack = new Stack<TreeNode>();
        TreeNode node = root;
  
      
        while (!stack.empty() || node != null){
	        if(node !=null){
	        	stack.push(node);
	        	node = node.left;
	        }
	        else{
	        	
		        node = stack.peek();
		        result.add(stack.pop().val);
			    node = node.right;
		        
	        }
	        
	        
        }
        return result;
        
        
    }