#include #include #include #include #ifndef sc5 #define sc5 '\0' #endif #define sv1 30 #define sc8 -1 #define sv14 256 #define sc7 17 char sv9[sc7][25]={"","AtLeaf","GoRoot","ExistsChild","GoChild", "FirstChild","NextChild","AddChild","RemoveChild","PutInfo", "GetInfo","GotoNode","GetNode","Show","Show (2)","Opnieuw beginnen","Stoppen"}; #include "general.h" #include "trie.cc" #include "showlist.h" #include "leestekst.h" ifstream sv10;ofstream sv11;int sv12,sv13; void sf5(char*sv29,char*sv75,char*sv21,char*sv22){int sv30; sv30=strcspn(sv29,".");strncpy(sv75,sv29,sv30);sv75[sv30]=sc2; strcat(sv75,"_1.inv");strncpy(sv21,sv29,sv30);sv21[sv30]=sc2; strcat(sv21,".uit");strncpy(sv22,sv29,sv30);sv22[sv30]=sc2;strcat(sv22,".con"); }/*sf5*/void sf18(ofstream&sv76,int sv330,char*sv77,char*sv78){sv76<>sv17;else {sv10>>sv33;sv17=sv33;sf2(sv10);cout<*T){cout<AtLeaf()) {cout<<"We bevinden ons in een blad.\n";if(!sv12)sf18(sv11,1,"","");}else {cout<<"We bevinden ons niet in een blad.\n";if(!sv12)sf18(sv11,0,"","");}} void sf9(Trie*T){char sv17;cout<ExistsChild(sv17)) {cout<<"Het karakter `"<*T){char sv17;cout<ExistsChild(sv17))T->GoChild(sv17);else{cout<*T) {char sv17;cout<FirstChild();if((sv17!=sc5)||(T->ExistsChild(sc5))) {cout<<"Het eerste kind van de huidige knoop is `"<*T,char sv17,char sv34){char sv49;if(sv17==sv34) return false;else{sv49=T->FirstChild();while((sv49!=sv17)&&(sv49!=sv34)) sv49=T->NextChild(sv49);if(sv49==sv17)return true;else return false;}} bool sf20(Trie*T,char sv17,char sv34){if(sv34!=sc5)return true;else if(!(T->ExistsChild(sc5)))return false;else if(sf19(T,sv17,sc5))return true;else return false;}void sf12(Trie*T){char sv17,sv34;cout<ExistsChild(sv17)) {sv34=T->NextChild(sv17);if(sf20(T,sv17,sv34)) {cout<<"Het volgende kind van de huidige knoop na het kind `"<*T){char sv17;cout<AddChild(sv17);}void sf14(Trie*T,TrieNode*&sv35){char sv17; TrieNode*sv36;bool sv50;cout<ExistsChild(sv17)){sv36=T->GetNode();T->GoChild(sv17); if(T->GetNode()==sv35)sv50=true;else sv50=false;T->GotoNode(sv36);cout<RemoveChild(sv17);if(sv50&&(!(T->ExistsChild(sv17))))sv35=sc3;}else {cout<*T) {int sv33;cout<>sv33;else{sv10>>sv33;sf2(sv10);cout<PutInfo(sv33);}void sf16(Trie*T){int sv33; sv33=T->GetInfo();cout<*T,TrieNode*sv35){ if(sv35!=sc3)T->GotoNode(sv35);else{cout<0){sv51--; return true;}else return false;}template void sf22(Trie*T,st6*sv79,char sv44,int&sv52,TrieNode*sv46){st5*sv81; st6*sv80;TrieNode*sv47;char sv17;int sv51;bool sv53;sv47=T->GetNode(); if(sv47==sv46)sv81=new st5((int)(T->GetInfo()),sv44,true,sv52);else sv81=new st5((int)(T->GetInfo()),sv44,false,sv52);if(sv79->sf30()==sc3) {sv79->sf30(sv81);sv79->sf31(sv81);}else{sv79->sf31()->sf29(sv81); sv79->sf31(sv81);}if(T->ExistsChild(sc5))sv51=1;else sv51=0; sv17=T->FirstChild();sv53=false;while(sf21(sv17,sv51)){sv53=true; T->GoChild(sv17);if(sv79->sf29()==sc3){sv80=new st6();sv79->sf29(sv80);} sf22(T,sv79->sf29(),sv17,sv52,sv46);T->GotoNode(sv47);sv17=T->NextChild(sv17); sv52++;}if(sv53)sv52--;}void sf23(st6*sv54,bool sv55){st6*sv79;st5*sv81; int sv52,sv56,sv45;sv79=sv54;sv45=0;do{sv81=sv79->sf30();sv52=0;do {sv56=sv81->sf28();while(sv52sf25();if(sv81->sf27())cout<<'*';else cout<<','; cout<sf26();if((!sv12)&&(sv55)){sf18(sv11,sv45,"",""); sf18(sv11,sv52,"","");sf18(sv11,sf7(sv81->sf26()),"","");}sv52++; sv81=sv81->sf29();}while(sv81!=sc3);cout<sf29();sv45++; }while(sv79!=sc3);}templatevoid sf24(Trie*T,bool sv55){st6*sv57; int sv52;TrieNode*sv46;cout<GetNode();T->GoRoot();sv57=new st6();sv52=1;sf22(T,sv57,' ',sv52,sv46); sf23(sv57,sv55);delete sv57;T->GotoNode(sv46);}int main(){int sv39,sv38,i,sv40; Trie*T;TrieNode*sv35;ifstream sv41;char sv29[sv1],sv75[sv1],sv21[sv1], sv22[sv1];bool sv42;cout.setf(ios::unitbuf);sv41.open("test.dat",ios::in); if(sv41){sf3(sv41,"InterActief = ");sv41>>sv12;}else {cout<<"We konden `test.dat' niet openen\n";cout<;sv35=sc3;do{cout<>sv40;else{sv10>>sv40;sf2(sv10); cout<=1)&&(sv40<=sv39)){sf18(sv11,sv40,"","");}else {sf18(sv11,sv40,"","");}}switch(sv40){case 1:sf8(T);break;case 2:T->GoRoot(); break;case 3:sf9(T);break;case 4:sf10(T);break;case 5:sf11(T);break; case 6:sf12(T);break;case 7:sf13(T);break;case 8:sf14(T,sv35);break; case 9:sf15(T);break;case 10:sf16(T);break;case 11:sf17(T,sv35);break; case 12:sv35=T->GetNode();break;case 13:sf24(T,false);break; case 14:sf24(T,true);break;case 15:delete T;T=new Trie;sv35=sc3;break; case 16:break;default:cout<