Skip to content
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

Add VisitChildren functionality to path.Map #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kimmidi
Copy link
Contributor

@kimmidi kimmidi commented Oct 26, 2021

The data structure internally maintains a list of children of the node.

The data structure internally maintains a list of children of the node.
@jfrabaute
Copy link
Contributor

How does one decide the way the tree is traversed as there are several ways to traverse the tree?

@kimmidi
Copy link
Contributor Author

kimmidi commented Oct 26, 2021

I'm not sure I understand your question. If there are several matches for the provided path due to wildcards, every matching node's children are visited.

@jfrabaute
Copy link
Contributor

How is the tree traversed in the current implementation? (reference: https://en.wikipedia.org/wiki/Tree_traversal#Types)
depth first? pre-order? post-order? in-order?

@kimmidi
Copy link
Contributor Author

kimmidi commented Oct 26, 2021

It's not a complete tree traversal for the Visit methods, so it's not a clear answer. I'd characterize it more as BFS, as the ordering amongst child nodes is not guaranteed due to it being a map. The root certainly before the children.

But I don't see the connection with this pull request ?

@jfrabaute
Copy link
Contributor

But I don't see the connection with this pull request ?

I suppose this functionality is added for clients to use. Some clients might know how is the tree traversal is happening (or do it in a specific way) based on what they're doing, hence my question.

@kimmidi
Copy link
Contributor Author

kimmidi commented Oct 27, 2021

I suppose this functionality is added for clients to use. Some clients might know how is the tree traversal is happening (or do it in a specific way) based on what they're doing, hence my question.

OK. There are no guarantees wrt the order within the children nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants