Skip to content

Commit

Permalink
Clarifications for binary-search-tree exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
glennj committed Sep 10, 2024
1 parent c32ab51 commit 024bcf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 024bcf2

Please sign in to comment.