input: Write a python function to create a binary search tree and implement search functionality.
  assert tree.search(3) == True
  assert tree.search(8) == False
  assert tree.search(1) == True
output: class TreeNode:
      def __init__(self, key):
          self.left = None
          self.right = None
          self.val = key
  
  class BinarySearchTree:
      def __init__(self):
          self.root = None
  
      def insert(self, key):
          if self.root is None:
              self.root = TreeNode(key)
          else:
              self._insert(self.root, key)
      
      def _insert(self, node, key):
          if key < node.val:
              if node.left is None:
                  node.left = TreeNode(key)
              else:
                  self._insert(node.left, key)
          else:
              if node.right is None:
                  node.right = TreeNode(key)
              else:
                  self._insert(node.right, key)
  
      def search(self, key):
          return self._search(self.root, key)
      
      def _search(self, node, key):
          if node is None:
              return False
          if node.val == key:
              return True
          elif key < node.val:
              return self._search(node.left, key)
          else:
              return self._search(node.right, key)
  
  # Example usage:
  tree = BinarySearchTree()
  tree.insert(5)
  tree.insert(3)
  tree.insert(7)
  tree.insert(1)
  tree.insert(4)
  
  assert tree.search(3) == True
  assert tree.search(8) == False
  assert tree.search(1) == True