// CodeTreeTest.cpp // // Chris Nevison // May 12, 2002 // // Solution for the Advanced Placement Computer Science AB exam, // free response 4, test program #include "CodeTree.h" int main() { CodeTree CT1("---s-niuy"); cout << CT1.BitsToWord("1110") << endl; cout << CT1.BitsToWord("000101010011") << endl; cout << endl; cout << CT1.WordToBits("in") << endl; cout << CT1.WordToBits("sunny") << endl; cout << endl << endl; CodeTree CT2("---gi----nefhos"); cout << CT2.WordToBits("gone") << " " << CT2.WordToBits("fishing") << endl; cout << CT2.BitsToWord(CT2.WordToBits("gone")) << " " << CT2.BitsToWord(CT2.WordToBits("fishing")) << endl; return 0; }