problem-specifications icon indicating copy to clipboard operation
problem-specifications copied to clipboard

Update binary search tree documentation

Open ccapndave opened this issue 4 years ago • 5 comments

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 t shouldBe Just 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 avatar Jun 02 '21 10:06 ccapndave

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.

ccapndave avatar Jun 02 '21 10:06 ccapndave

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

petertseng avatar Jun 03 '21 18:06 petertseng

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

ccapndave avatar Jun 03 '21 18:06 ccapndave

It's all yours.

petertseng avatar Jun 03 '21 22:06 petertseng

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

ErikSchierboom avatar Jan 13 '22 15:01 ErikSchierboom