

#include <iostream>

#include "btree.h"
#include "bstree.h"
#include "avltree.h"

#include "pqueue.h"

#include "table.h"

// Test BSTree class
void
test_bstree ()
{
  int i;
  BSTree<int> t;
  
  t.Insert (i=3); cout << t << endl;
  t.Insert (i=5); cout << t << endl;
  t.Insert (i=10); cout << t << endl;
  t.Insert (i=15); cout << t << endl;
  t.Insert (i=20); cout << t << endl;
}

// Test the ADT Table Class
void
test_table ()
{
  int i;
  string s;
  Table<int> t;

  t.Insert (s = "first",  i=10); cout << t << endl;
  t.Insert (s = "second", i=20); cout << t << endl;
  t.Insert (s = "third",  i=30); cout << t << endl;
  t.Insert (s = "fourth", i=40); cout << t << endl;
  t.Insert (s = "fifth",  i=50); cout << t << endl;

}

// Test the Priority Queue Class
void
test_pqueue ()
{
  int i;
  char c;
  PQueue<char> h;

  h.Enqueue (i=40, c='a'); cout << h;
  h.Enqueue (i=20, c='b'); cout << h;
  h.Enqueue (i=30, c='c'); cout << h;
  h.Enqueue (i=25, c='d'); cout << h;
  h.Enqueue (i=15, c='e'); cout << h;
  h.Enqueue (i=35, c='e'); cout << h;

  h.Dequeue (c); cout << c << " " << h;
  h.Dequeue (c); cout << c << " " << h;
  h.Dequeue (c); cout << c << " " << h;
  h.Dequeue (c); cout << c << " " << h;
  h.Dequeue (c); cout << c << " " << h;
  h.Dequeue (c); cout << c << " " << h;
}


// Test everything
int
main (int argc, char *argv[])
{
  
  test_bstree ();
  test_pqueue ();
  test_table ();

  return 0;
}

