public List<Integer> preorderTraversal(TreeNode root) {
			List<Integer> result = new ArrayList<Integer>();
			if (root == null)
				return result;

			TreeNode cur = root;
			Stack<TreeNode> parentStack = new Stack<TreeNode>();

			while (!parentStack.isEmpty() || cur != null) {
				if (cur != null) {
					result.add(cur.val);
					parentStack.push(cur);
					cur = cur.left;
				} else {
					cur = parentStack.pop();
					cur = cur.right;
				}
			}
			return result;
		}