|
CS-285 -- Lab 3: Generic Algorithm Implementation Winter Quarter 1999-2000 Electrical Engineering and Computer Science Department CC-27C, 277-7339 PurposeThe purpose of this lab assignment is to provide exposure to iterators and generic algorithms. This is accomplished by designing and implementing a generic algorithm the same functionality as the STL's generic algorithm replace_if(). AssignmentThe heavy emphasis on iterators in STL makes it possible to implement generic algorithms that can be used on multiple container types (provided that the correct type of iterator is available). These generic algorithms alleviate the need to write unique member functions for each container type. Not only does it reduce the amount of code that needs to written, debugged, and maintained, it also provides a common interface for all container classes that have the correct type of iterator needed by the generic algorithm. In this lab, you are to do the following:
Note: You may alternatively decide to make your predicate a function object in which case you are not required to implement isconsonant() and isvowel() as boolean functions. You are still required to implement the functionality required in step 3. Lab report (due 11:00pm, the day prior to week 7 lab)The lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. If you have any questions, consult the instructor. This page was created by Dr. Christopher C. Taylor, copyright 1998-2000. |