Simple Binary Search || Easy to understand || Python
Since the given tree is Binary Search Tree, It follows the rule that :\n1. value of right node is greater than the value  of current node .\n2. value of left no
Since the given tree is Binary Search Tree, It follows the rule that :\n1. value of right node is greater than the value  of current node .\n2. value of left node is less than the value of current node.\n\nOn the basis of above information we can perform searching in following steps:\n1. while with condition current node not equal to None.\n\ta. If required value is equal to value current node then return the node.\n\tb. if required value > value of current node then update current node to current node\'s right node.\n\tc. if required value < value of current node then update current node to current node\'s left node.\n2. return Null outside while loop (if no such node found then we have to reutrn NULL (None in case of python))\n\n\nPython Code:\n\n\n    \n    def searchBST(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]:\n        \n        temp=root\n        while(temp!=None):\n            if temp.val==val: \n                return temp\n            elif val>temp.val:\n                temp=temp.right\n            else:\n                temp=temp.left\n        return None\n\n\n
[]