Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. abstract class Tree {}
  4.  
  5. class Leaf extends Tree {
  6. function __construct($n) {
  7. $this->value = $n;
  8. }
  9. }
  10.  
  11. class Node extends Tree {
  12. function __construct($n, Tree $left, Tree $right) {
  13. $this->value = $n;
  14. $this->left = $left;
  15. $this->right = $right;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement