as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write an algorithm to implement a binary search tree.
user
def insert(node, data): 
    # if the tree is empty, return a new node 
    if node is none: 
        return node(data) 
  
    # otherwise, recur down the tree
    if data < node.data: 
        node.left = insert(node.left, data) 
    else: 
        node.right = insert(node.right, data) 
  
    # return the (unchanged) node pointer 
    return node 
  
# function to search a given data 
def search(node, data): 
      
    # base case: if root is none or key is present at root 
    if node is none or node.data == data: 
        return node 
  
    # key is greater than root's key 
    if node.data < data: 
        return search(node.right, data) 
  
    # key is smaller than root's key 
    return search(node.left, data)
assistant