Click to See Complete Forum and Search --> : Binary Tree


Brandon
February 22nd, 2000, 01:41 PM
I have a binary tree which contains individuals with various ID numbers. I need to search the tree for a specific ID# and return if found. Any help would be appricated. Not sure where to start

Thks,
Brandon

Clearcode
February 23rd, 2000, 03:11 AM
Assuming its a sorted binary tree (which is the point of same) then you start at the root node. If the id of this is greater than the one you need check the left node else check the right node. Iterate while not found and left/right node exists.