Skip to content

Instantly share code, notes, and snippets.

@vanbrabantf
Created April 2, 2021 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanbrabantf/d247ad5efff2d9c1b6e1a555f4c82fab to your computer and use it in GitHub Desktop.
Save vanbrabantf/d247ad5efff2d9c1b6e1a555f4c82fab to your computer and use it in GitHub Desktop.
<?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