Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6vDJ5fWY5uEZaJFNi
16 lines
374 B
Plaintext
16 lines
374 B
Plaintext
Search the sample tree
|
|
======================
|
|
|
|
search 65:
|
|
at 50: 65 > 50, go right
|
|
at 70: 65 < 70, go left
|
|
at 60: 65 > 60, go right
|
|
at 65: equal, found after 4 nodes
|
|
search 45:
|
|
at 50: 45 < 50, go left
|
|
at 30: 45 > 30, go right
|
|
at 40: 45 > 40, go right
|
|
null reached after 3 nodes: 45 is not in the tree
|
|
|
|
min = 20 (keep going left), max = 80 (keep going right)
|