tuplle / grove

Lightweight javascript library for tree data structures.
MIT License
1 stars 3 forks source link

Added Cardinal Trees Support #21

Closed navi13479 closed 5 days ago

navi13479 commented 3 weeks ago

Added implementation of cardinal trees

Implemented basic structure and algorithms for cardinal trees. Added unit tests to verify the correctness of the implementation.

I would ask for review and possible approval, thank you.

tuplle commented 5 days ago

I do not know if labelling edges of node's children with characters to index whole words in k-degree cardinal is relevant or if it has a useable use-case. I'll give you a counterargument to your implementation. If you have a 2. degree cardinal tree and insert the word "turtle" and then insert the word "programming" it will fill all allowed children (2 for each node, since it is a 2. degree tree) and then you cannot insert another word into the tree as you filled the structure and cannot expand it further.

As your implementation is correct and the tree is doing what it suppose to, I approve this PR. :+1: