Add bst module: recursive and iterative insert/search, three delete cases, BST validation, kth smallest, LCA, floor/ceiling, balance check and 10 problems cross-checked against brute force (25 tests, 16 transcripts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6vDJ5fWY5uEZaJFNi
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
floor and ceiling of 45 on the sample tree: the best candidate so far
|
||||
=====================================================================
|
||||
|
||||
floor(45):
|
||||
at 50: too big, best = none, go left
|
||||
at 30: candidate, best = 30, go right
|
||||
at 40: candidate, best = 40, go right
|
||||
answer 40
|
||||
ceiling(45):
|
||||
at 50: candidate, best = 50, go left
|
||||
at 30: too small, best = 50, go right
|
||||
at 40: too small, best = 50, go right
|
||||
answer 50
|
||||
|
||||
floor(10) = OptionalInt.empty, ceiling(90) = OptionalInt.empty
|
||||
Reference in New Issue
Block a user