Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Data Structures & Algorithms) expand_more
Complexity & Foundations
Arrays & Strings
Linked Lists
Stacks & Queues
Hashing
Trees & Heaps
Graphs
Sorting Searching & DP

Binary search tree search

Learn Binary search tree search in Data Structures & Algorithms with a focused explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Intermediate
data-structures-algorithms-056.py
python
tree=(8,(3,None,None),(10,None,None))
def find(node,x):
    while node:
        v,l,r=node
        if v==x:return True
        node=l if x<v else r
    return False
print(find(tree,10))
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content