Created
April 2, 2021 14:22
-
-
Save vanbrabantf/d247ad5efff2d9c1b6e1a555f4c82fab 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 | |
class Node | |
{ | |
private $value; | |
private $left; | |
private $right; | |
public function __construct(string $value, ?Node $left, ?Node $right) | |
{ | |
$this->left = $left; | |
$this->right = $right; | |
$this->value = $value; | |
} | |
public function getValue(): string | |
{ | |
return $this->value; | |
} | |
public function getLeft(): ?Node | |
{ | |
return $this->left; | |
} | |
public function getRight(): ?Node | |
{ | |
return $this->right; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment