// sl-4-DHBW-Inf2
#include <cstdlib>
#include <iostream>
#include "suchbaum.h"
#include "avlbaum.h"
#include "visualbinbaum.h"

using namespace std;

int main(void) {
  cout << "... a small program introducing avl trees ..." << endl;
  cout << "... output: avl tree + binary tree with avl balances ..." << endl;
//  cout << "... first a fibo tree of height 5 is created ..." << endl;
  avlPtr travl = NULL;
//  avlInsertFiboOfHeight(travl,5);
//  cout << travl;
  int zahl;
  cout << "Erster Wert (positiv=einfuegen, negativ=loeschen, 0=Abbruch): ";
  cin >> zahl;
  while (zahl) {
    if (zahl>0) {
      avlInsert(travl,zahl);
      cout << travl;
    } else {
      avlDelete(travl,-zahl);
      cout << travl;
    }
    cout << "Nexter Wert: ";
    cin >> zahl;
  }
  system("Pause");
  return EXIT_SUCCESS;
}
