
#include <iostream>
#include "btree.h"

void Visitd (int& a, int d) { cout << a << " " << d << " "; }
void Visit  (int& a) { cout << a << " "; }

int
main (int argn, char *argv[])
{
  int a;
  BTree<int> bt1 (a=1), bt2 (a=2), 
    bt3 (a=3, bt1, bt2), bt4 (a=4), bt (a=0, bt4, bt3);

  cout << "Preorder:   "; bt.Preorder  (Visitd); cout << endl;
  cout << "Inorder:    "; bt.Inorder   (Visitd); cout << endl;
  cout << "Postorder:  "; bt.Postorder (Visitd); cout << endl;

  cout << "-----------------------------------------------" << endl;

  cout << "iPreorder:  "; bt.iPreorder  (Visit); cout << endl;
  cout << "iInorder:   "; bt.iInorder   (Visit); cout << endl;
  cout << "iPostorder: "; bt.iPostorder (Visit); cout << endl;

  return 0;
}

