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

Clarifications for binary-search-tree exercise #342

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions exercises/practice/binary-search-tree/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ignore

## CoffeeScript specific instructions

A BinarySearchTree instance must have 3 properties: `data`, `left` and `right`.

An instance must have these methods:

* `insert` which adds a new piece of data to the tree. This will add a new "leaf" node somewhere in the tree.
* `each` that takes a "callback" argument. That is a function that will be called on _each piece of data_ in the tree **in order**.

This exercise is a great place to practice **recursion**.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class BinarySearchTree

insert: (args) ->

data: ->
each: (callback) ->

module.exports = BinarySearchTree