Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

recursively fing root of tree

 public TreeNode FindTarget(TreeNode root, int val)
{
   if (root == null || root.val == val) return root;

   if (root.val < val)
     return FindTarget(root.right, val);
   else
     return FindTarget(root.left, val);
}
 
PREVIOUS NEXT
Tagged: #recursively #fing #root #tree
ADD COMMENT
Topic
Name
6+1 =