Skip to content

Commit fc14fb6

Browse files
authored
Clarifications for binary-search-tree exercise (#342)
1 parent c32ab51 commit fc14fb6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ignore
2+
3+
## CoffeeScript specific instructions
4+
5+
A BinarySearchTree instance must have 3 properties: `data`, `left` and `right`.
6+
7+
An instance must have these methods:
8+
9+
* `insert` which adds a new piece of data to the tree. This will add a new "leaf" node somewhere in the tree.
10+
* `each` that takes a "callback" argument. That is a function that will be called on _each piece of data_ in the tree **in order**.
11+
12+
This exercise is a great place to practice **recursion**.

exercises/practice/binary-search-tree/binary-search-tree.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ class BinarySearchTree
44

55
insert: (args) ->
66

7-
data: ->
7+
each: (callback) ->
88

99
module.exports = BinarySearchTree

0 commit comments

Comments
 (0)