Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

tree search

// search for target in  a tree using recursive function  
const treeIncludes = (target , root )=>{

if(root===null)return false;
if(root.data===target) return true ;
return treeIncludes(target , root.left ) || treeIncludes(target , root.right );

}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #tree #search
ADD COMMENT
Topic
Name
3+3 =