haleyhousellc / arboriculture

A simple tree library written in TypeScript.
https://haleyhousellc.github.io/arboriculture
ISC License
2 stars 0 forks source link

Remove node tracking in tree #20

Closed haleyga closed 6 years ago

haleyga commented 6 years ago

Stop maintaining an internal node count for a given tree. It has become cumbersome to increment and decrement nodes.

Since it is typically more important to store stuff in trees than it is to count stuff in trees, reimplement an internal count as a tree-agnostic size() function that accepts a tree and returns the number of nodes. Tree