-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarifications for binary-search-tree exercise (#342)
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
exercises/practice/binary-search-tree/.docs/instructions.append.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ class BinarySearchTree | |
|
||
insert: (args) -> | ||
|
||
data: -> | ||
each: (callback) -> | ||
|
||
module.exports = BinarySearchTree |