#include #include "rbt.h" /* // character keys. class Chars {public: typedef char keyType; static char keyMin = 0; }; // integer associated info. class Data {public: typedef int infoType; static int infoNil = 0; }; */ main() { char action; char key; int info; Dict T(0); int N = 0; cout <<"s k -- to search for info with key k, or \n"; cout <<"i k d -- to insert data d under key k.\n"; cout <<"d -- to display the tree (rotated 90 degrees).\n"; cout <<"q -- to quit.\n"; cout <<"ACTION: "; while (cin >> action ) { cout << action; switch (action) { case 's': cin >> key; cout << " " << key << '\n'; cout << "for " << key << " info is " << T.search(key) << '\n'; break; case 'i': cin >> key; cin >> info; cout << " " << key << " " << info << '\n'; T.insert(key, info); cout << "inserted " << key << ", N is " << ++N << '\n'; //break; case 'd': cout << '\n'; T.display(1); break; case 'q': return 0; default: cout <<"\nUnknown action: " << action << '\n'; } cout <<"\nACTION: "; } return 0; }