As in the previous recitations/hw, first you need to get some already implemented programs from the textbook. Specifically, get all the files under 09-Efficiency-and-ADTs from the class web page. You can get all by simply following the link "programs from the textbook" and then go to 00-zip-files and get 09-Efficiency-and-ADTs.zip and unzip it under directory X. I assume that you already got the booklib and installed it under directory X, as we described in previous recitations (if not, please follows the instructions at the end of this recitation to get booklib and 09-Efficiency-and-ADTs and save them under directory X)
Then go to 09-Efficiency-and-ADTs, and simply say make to compile editor.c program with different implementation of buffer ADT. Then run editor program.
After compiling/testing existing client/diver program called array-editor, stack-editor, and list-editor that uses different implementations of buffer ADT, you need to implement the following functions under single linked list in listbuf.c (you can try to implement them under other representations (i.e., array and stack) later at your own time).
void ReplaceCharInBuffer(bufferADT buffer, char oldch, char newch);
int SearchStrBuffer(bufferADT buffer, char* str);
To compile new version, use the following
> make list-editor
Note: other implementations array- and stack- will not work until you implement the above functions in them too. But their implementation is not part of this recitation. You can try to implement them later in your own time....
As always, make sure you release (free) the dynamically allocated memories if you allocate any memory in your programs. So, before submitting your program, run it with valgrind to see if there is any memory leakage
Also if you need to debug your program, compile your programs with -g option and then run it with gdb and/or ddd.