golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.54k stars 521 forks source link

[tour] Equivalent Binary Trees exercise uses Binary Search Tree (BST). #1072

Open mvuksano opened 4 years ago

mvuksano commented 4 years ago

In the exercise "Equivalent Binary Trees" binary search trees (BST) are used but text uses term "binary tree". I suggest using binary search tree term instead of binary tree as it implies that nodes are inserted according to a rule (lesser elements go to the left). Technically speaking two binary trees that are not sorted and contain same elements will not necessarily return elements in order using "in order traversal" (left node, current node, right node). This technique will only work on binary search trees.

snugghash commented 3 years ago

Seems like a duplicate of https://github.com/golang/tour/issues/403#issuecomment-401782939. What do you think?

davidhcefx commented 1 year ago

As a person with CS background, I can quickly get what it meant:

[1, 1, 2, 3, 5, 8, 13]. Yeah, of course, it's the result of an in-order tree walk for both structures!

But for someone not so familiar to things like the properties of binary search tree, the different kinds of tree traversals, it might be confusing since there are no keywords related to "binary search tree" mentioned on that page for them to google up.