Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Node.prototype.push
should also be implemented, if two different classes are usedNo sample tests
Declaring
BST
as an object with aroot
that's a binary treeNode
is a bad practice (and doesn't make much sense either), because it ignores the invariant that any branches of aBST
is, obviously, still aBST
; instead you only provide a weaker guaranteed that any branches of aBST
is a binary tree. Also it makes the code ofBST
operations a bit more complicated because of this.Declaring
BST
as an object with aroot
that's a binary treeNode
is a bad practice (and doesn't make much sense either), because it ignores the invariant that any branches of aBST
is, obviously, still aBST
; instead you only provide a weaker guaranteed that any branches of aBST
is a binary tree. Also it makes the code ofBST
operations a bit more complicated because of this.The code and the Kata description are slightly out of sync
BST
versusBinarySearchTree
Error messages in Test Cases are incorrect.
Also, need random tests.
Again, move Node() and BST() to Preloaded?
Wouldn't it be cleaner to move the Node() and BST() definitions into the Preloaded section?
Documentation is in the Description already, and user isn't supposed to muck with it anyway.