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,13 @@
|
||||
isBalanced: height recomputed at every node versus one postorder pass (node visits)
|
||||
===================================================================================
|
||||
|
||||
sample tree: height 4, balanced true
|
||||
|
||||
tree balanced top-down one pass
|
||||
perfect, n = 1023 true 8194 1023
|
||||
perfect, n = 16383 true 196610 16383
|
||||
chain, n = 1000 false 999 1000
|
||||
chain, n = 2000 false 1999 2000
|
||||
comb 100, n = 5050 false 171603 106
|
||||
comb 200, n = 20100 false 1353203 206
|
||||
comb 400, n = 80200 false 10746403 406
|
||||
Reference in New Issue
Block a user