Adrian Kuta
|
c45c5b7afa
|
feat: stack-safe traversal + lazy Sequence + navigation/functional extensions
Core additive work for v3.4 (non-breaking):
- Rewrite nodeCount(), height(), clear() and the post-order iterator iteratively
so deep/degenerate trees no longer throw StackOverflowError (verified to 50k deep).
- Add lazy Sequence traversal: asSequence(order), pre/post/levelOrderSequence().
- Add navigation extensions: isLeaf, degree, root(), ancestors(), siblings(),
leaves(), descendants().
- Add functional extensions: findNode, filterNodes, anyNode, allNodes, countNodes,
foldNodes, mapValues, deepCopy, structurallyEquals (all stack-safe).
- Add tests for stack-safety, the new APIs, and previously-uncovered
height/depth/nodeCount/path (incl. exception paths). 40 tests green on JVM.
|
2026-06-06 13:35:39 +02:00 |
|