daily pastebin goal
34%
SHARE
TWEET

Untitled

Danol Mar 30th, 2017 (edited) 8 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Node {
  2.     Node *left, Node *right;
  3.     Void #ctor( Int depth ) { // constructor
  4.         if( depth > 0 ) {
  5.             left = new Node( depth - 1 );
  6.             right = new Node( depth - 1 );
  7.         }
  8.     }
  9. }
  10.  
  11. @ctime Node *a = new Node( 5 );
  12. Node *b = new Node( 2 );
  13.  
  14. Void main() {
  15.     const( Node ) *ptr = userInput ? a : b;
  16.     printTree( ptr );
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top