Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Binary Search Tree in C++

Name: Anonymous 2007-11-27 9:02

hi, i was wondering if anyone had any examples of a Binary Search Tree written in C++?

thanks a lot

Name: Anonymous 2007-11-27 9:30


def search_binary_tree(node, key):
     if node is None:
         return None  # key not found
     if key < node.key:
         return search_binary_tree(node.left, key)
     else if key > node.key:
         return search_binary_tree(node.right, key)
     else:  # key is equal to node key
         return node.value  # found key

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List