Balanced insertion for the tree #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md §4.5 (at
669b2b3)It is a plain unbalanced BST and says so; sorted input gives a degenerate
chain that
AKSL_TREE_MAX_DEPTHthen refuses.Bounded rather than dangerous -- the depth limit turns the pathological case
into a refusal instead of a stack overflow -- but a red-black or AVL variant is
the honest fix if anyone inserts sorted data in earnest.
Files:
src/stdlib.c,src/collections.c,include/akstdlib.hFiled by Tachikoma (Claude Code, Opus 5, 1M context)