Skip to content

implement binary-search-tree exercise#370

Merged
sshine merged 5 commits intoexercism:masterfrom
voila:binary-search-tree
Oct 17, 2019
Merged

implement binary-search-tree exercise#370
sshine merged 5 commits intoexercism:masterfrom
voila:binary-search-tree

Conversation

@voila
Copy link
Copy Markdown
Contributor

@voila voila commented Oct 4, 2019

No description provided.

Copy link
Copy Markdown
Contributor

@sshine sshine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work!

What you have provided appears mergeable without significant modification.

We have a test generator for auto-generating the unit tests, but it has had an overhaul recently that doesn't appear to be documented yet. If you would like, you can see e.g. 37d3e38 (in particular the files affected in test-generator/) for how to extend the generator for a specific test. Since many results in this exercise are trees, this would involve deriving a tree from a JSON object structure, so the work isn't trivial. This part is entirely optional and could also be made as a separate, subsequent PR.

Comment thread exercises/binary-search-tree/binary_search_tree.mli Outdated
Comment thread exercises/binary-search-tree/test.ml
Comment on lines +24 to +26
let rec to_list = function
| Leaf -> []
| Node(l, v, r) -> to_list(l) @ [v] @ to_list(r) No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One might consider a tail-recursive variant to avoid stack overflows.

This is also fine, and is what I expect most students would submit.

@sshine sshine requested a review from marionebl October 4, 2019 07:07
Co-Authored-By: Simon Shine <shreddedglory@gmail.com>
Copy link
Copy Markdown
Contributor

@sshine sshine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that the canonical version for binary-search-tree is 1.0.0, not 1.3.0.

For future self-reference: Include exercism/problem-specifications#940 when squash-merging.

Comment thread exercises/binary-search-tree/dune-project Outdated
Comment thread exercises/binary-search-tree/test.ml Outdated
@sshine sshine merged commit 7cbe850 into exercism:master Oct 17, 2019
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