diff --git a/curriculum/challenges/english/10-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.md b/curriculum/challenges/english/10-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.md index db08d488a1..6f0734d97d 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.md +++ b/curriculum/challenges/english/10-coding-interview-prep/data-structures/find-the-minimum-and-maximum-height-of-a-binary-search-tree.md @@ -36,8 +36,10 @@ tests: testString: assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== 'function') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return (test.findMaxHeight() == 5); })()); - text: An empty tree should return a height of -1. testString: assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMaxHeight !== 'function') { return false; }; return (test.findMaxHeight() == -1); })()); - - text: The isBalanced method should return true if the tree is a balanced binary search tree. - testString: assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== 'function') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return !test.isBalanced(); })()); + - text: The isBalanced method should return false if the tree is an unbalanced binary search tree. + testString: assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== 'function') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.isBalanced() === false; })()); + - text: The isBalanced method should return true if the tree is a balanced binary search tree. + testString: assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== 'function') { return false; }; test.add(10); test.add(3); test.add(22); test.add(1); test.add(4); test.add(17); test.add(32); return test.isBalanced() === true; })()); ```