Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

command line coursera

          
//Binary Search Tree (BST): Function to search a value
bool BST_SearchTree(int Key){
    int  ValueInTree = false;
    TreeNode *temp;
    temp = root;
    while((temp != NULL) && (temp->Key != Key))
    {
        if(Key < temp->Key)
            temp = temp->left; 
        else
            temp = temp->right;
    }
    if(temp == NULL) 
		cout<< "NOT FOUND";
    else
        cout<< "FOUND";
}
        
Source by courses.edx.org #
 
PREVIOUS NEXT
Tagged: #command #line #coursera
ADD COMMENT
Topic
Name
4+9 =