From 38931db96bfacdea4d9526c95336d1290c9a6139 Mon Sep 17 00:00:00 2001 From: Rafal Date: Thu, 12 Jul 2018 16:11:16 +0200 Subject: [PATCH] Binary Tree isBalanced() method not accepted Requirement "The isBalanced method returns true if the tree is a balanced binary search tree." in this particular case will be always false, becuse assert for this challenge returns test.isBalanced() which will be negative and therefore assert itself as well. Commit should fix the problem. --- seed/challenges/08-coding-interview-prep/data-structures.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/08-coding-interview-prep/data-structures.json b/seed/challenges/08-coding-interview-prep/data-structures.json index 4ba9f81461f30a..49d18a6006c5bc 100644 --- a/seed/challenges/08-coding-interview-prep/data-structures.json +++ b/seed/challenges/08-coding-interview-prep/data-structures.json @@ -2357,7 +2357,7 @@ }, { "text": "The isBalanced method returns 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(); })(), 'The isBalanced method returns 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(); })(), 'The isBalanced method returns true if the tree is a balanced binary search tree.');" } ], "releasedOn": "Feb 17, 2017", @@ -3826,4 +3826,4 @@ } } ] -} \ No newline at end of file +}