Remove parent parameter from binary tree node constructor to simplify syntax.

This commit is contained in:
Oleksii Trekhleb
2018-05-30 08:16:41 +03:00
parent fcc546347d
commit b7e27b2f07
4 changed files with 8 additions and 10 deletions

View File

@@ -3,12 +3,11 @@ import Comparator from '../../utils/comparator/Comparator';
export default class BinaryTreeNode {
/**
* @param {*} [value]
* @param {BinaryTreeNode} [parent]
*/
constructor(value = null, parent = null) {
constructor(value = null) {
this.left = null;
this.right = null;
this.parent = parent;
this.parent = null;
this.value = value;
// This comparator is used to compare binary tree nodes with each other.