exercism / problem-specifications

Shared metadata for exercism exercises.
MIT License
326 stars 541 forks source link

Update binary search tree documentation #1809

Open ccapndave opened 3 years ago

ccapndave commented 3 years ago

In the tests for the binary-search-tree exercise, I think this assertion may be wrong as inserting a duplicate value into a BST has no effect (as checked by bstValue tshouldBeJust 4) and therefore I believe that bstLeft should be Nothing.

https://github.com/exercism/haskell/blob/23a8841dc163c0f82b9b999a16d5cf41e77c0fe3/exercises/practice/binary-search-tree/test/Tests.hs#L35

ccapndave commented 3 years ago

Actually I can see from the test case that duplicates actually are allowed:

https://github.com/exercism/haskell/blob/23a8841dc163c0f82b9b999a16d5cf41e77c0fe3/exercises/practice/binary-search-tree/test/Tests.hs#L35

In this case, it would be great to add a sentence to the instructions saying that duplicate values are allowed in the tree to clear up any confusion.

petertseng commented 3 years ago

Checked https://github.com/exercism/problem-specifications/blob/main/exercises/binary-search-tree/canonical-data.json and the test there implies a duplicate value is allowed. In that case, https://github.com/exercism/problem-specifications/blob/main/exercises/binary-search-tree/description.md should be updated so all tracks benefit

ccapndave commented 3 years ago

👍 Do you want to do it or shall I submit a PR?

petertseng commented 3 years ago

It's all yours.

ErikSchierboom commented 2 years ago

@ccapndave Would you be willing to create a PR to update the description (as suggested by @petertseng)?