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