Skip to content

Added BST #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 8, 2019
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
ashokdey committed Oct 8, 2019
commit 312e43a5d85d09cdd514e81d472480a103197388
2 changes: 1 addition & 1 deletion src/_DataStructures_/Trees/BST/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class BinarySearchTree {
/** returning an array so as to make testing easy */
let arr = [];
if (root === null) return [];
// eslint-disable-next-line no-console
arr.push(root.value);

const left = this.preorder(root.leftChild);
arr = [...arr, ...left];

const right = this.preorder(root.rightChild);
arr = [...arr, ...right];
return arr;
Expand Down