Skip to content

Conversation

@wwweert123
Copy link

No description provided.

@rklaehn
Copy link
Contributor

rklaehn commented Mar 2, 2024

Hm, there is also has_prefix and scan_prefix.

has_prefix will return true if the tree has values below the given prefix. scan_prefix will iterate over the entire tree below a prefix. What case does this fn enable that isn't possible with the two mentioned methods?

@wwweert123
Copy link
Author

wwweert123 commented Mar 2, 2024

Hi! Instead of checking whether the string provided is a prefix of a key in the set (what is done in has_prefix), the added is_prefix checks whether any keys in the set is a prefix of the string provided.

For example,
radixtree1 = {"www.google.com", "www.youtube.com"}

radixtree1.is_prefix("www.google.com/webhp") will return true

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