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

tree: document sorted nature of random trees #1467

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

Conversation

crisman
Copy link

@crisman crisman commented Mar 21, 2023

For the use that the tour makes of "golang.org/x/tour/tree" it is important that the generated trees are sorted. While New() does generate sorted trees it is current documented as "returns a new, random binary tree" and many readers will assume "random" implies "non-sorted".

Update doc that trees are "randomly-structured, sorted" to clarify what is random and that trees are sorted.

For the use that the tour makes of "golang.org/x/tour/tree" it is
important that the generated trees are sorted. While New() does generate
sorted trees it is current documented as "returns a new, random binary
tree" and many readers will assume "random" implies "non-sorted".

Update doc that trees are "randomly-structured, sorted" to clarify what
is random and that trees are sorted.
@gopherbot
Copy link

This PR (HEAD: 7c6a425) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tour/+/478315 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

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