-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't assume stored children #53
Comments
I think this is potentially reasonable, but a lot of the appeal of this package is the printing (and a very distant second the tree traversal code), neither of which you can do without being able to retrieve children. Do you have a particular usecase in mind? |
Backtracking pointers in dynamic programming, e.g. storing the |
How would that application benefit from generic code written with other kinds of trees in mind? I guess I'm trying to figure out if those kinds of trees really fit in. |
I don't have a good answer to that question unfortunately. I think it had struck me as a natural generalization, however I see your point. An iterator from node to root (which I believe this package does not provide yet) would work on trees without children links. There could also be functions to convert between representations. |
There's a trait for
ParentLinks
andSiblingLinks
, it would be great if there was aChildrenLinks
trait too. Of course, a tree needs at least one of {link to children, link to parent}.The text was updated successfully, but these errors were encountered: