public boolean hasPathSum(TreeNode root, int sum){
		 if(root == null) return false;
		 
		 LinkedList<TreeNode> nodes = new LinkedList<TreeNode>();
		 LinkedList<Integer> sumValu = new LinkedList<Integer>();
		 
		 nodes.add(root);
		 sumValu.add(root.val);
		 
		 
		 while(!nodes.isEmpty()){
			 
			 TreeNode currentNode = nodes.poll();
			 int total = sumValu.poll();
			 
			 if(currentNode.left == null && currentNode.right == null && total == sum){
				 return true;
			 }
			 
			 if(currentNode.left != null){
				 nodes.add(currentNode.left);
				 sumValu.add(total+currentNode.left.val);
			 }
			 
			 if(currentNode.right != null){
				 nodes.add(currentNode.right);
				 sumValu.add(total+currentNode.right.val);
			 }
			 
		 }
		 
		 return false;
		 
	 }