Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- abstract class Tree {}
- class Leaf extends Tree {
- function __construct($n) {
- $this->value = $n;
- }
- }
- class Node extends Tree {
- function __construct($n, Tree $left, Tree $right) {
- $this->value = $n;
- $this->left = $left;
- $this->right = $right;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement