Last active
January 21, 2020 11:18
-
-
Save Basemera/2d6238461f421c8e3b071c3e33302620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is a class for creating the binary nodes | |
*/ | |
class BinaryNode { | |
private $data; | |
private $left; | |
private $right; | |
public function __construct(string $data = NULL) { | |
$this->data = $data; | |
$this->left = NULL; | |
$this->right = NULL; | |
} | |
/** | |
* Adds child nodes | |
*/ | |
public function addChildren($left, $right) { | |
$this->left = $left; | |
$this->right = $right; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment