http://nameless.cis.udel.edu/class_wiki/index.php?title=CISC220_F2021_Lab4&feed=atom&action=historyCISC220 F2021 Lab4 - Revision history2024-03-29T07:56:05ZRevision history for this page on the wikiMediaWiki 1.28.0http://nameless.cis.udel.edu/class_wiki/index.php?title=CISC220_F2021_Lab4&diff=1953&oldid=prevCer at 15:47, 30 August 20212021-08-30T15:47:07Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 15:47, 30 August 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l18" >Line 18:</td>
<td colspan="2" class="diff-lineno">Line 18:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Include a '''PDF file''' <Your Name>_README.pdf which contains the inputs and outputs of your program, etc.  For insert_ordered(), try several different input files (such as the ones included with filecleaner), but only include outputs of shorter files.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Include a '''PDF file''' <Your Name>_README.pdf which contains the inputs and outputs of your program, etc.  For insert_ordered(), try several different input files (such as the ones included with filecleaner), but only include outputs of shorter files.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Create a single tar/zip/rar file out of the top-level and all subdirectories.  This archive file should be named <Your Last Name>_Lab4.tar (or .zip or .rar, etc.).  </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Create a single tar/zip/rar file out of the top-level and all subdirectories.  This archive file should be named <Your Last Name>_Lab4.tar (or .zip or .rar, etc.).  </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Submit it in Canvas by ''midnight at the end of <del class="diffchange diffchange-inline">Thursday</del>, September <del class="diffchange diffchange-inline">25</del>''</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Submit it in Canvas by ''midnight at the end of <ins class="diffchange diffchange-inline">Tuesday</ins>, September <ins class="diffchange diffchange-inline">28</ins>''</div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC220_F2021_Lab4&diff=1930&oldid=prevCer: Created page with "==Lab #4== A ''List'' is a dynamic, linear data structure that allows insertion and removal at arbitary locations, including both ends. The full ADT for an STL List is defin..."2021-08-30T14:40:15Z<p>Created page with "==Lab #4== A ''List'' is a dynamic, linear data structure that allows insertion and removal at arbitary locations, including both ends. The full ADT for an STL List is defin..."</p>
<p><b>New page</b></p><div>==Lab #4==<br />
<br />
A ''List'' is a dynamic, linear data structure that allows insertion and removal at arbitary locations, including both ends. The full ADT for an STL List is defined [http://www.cplusplus.com/reference/list/list/ here]. <br />
* A Stack can be implemented as a List which uses push_back() for push() and pop_back() for pop()<br />
* A Queue can be implemented as a List which uses push_back() for enqueue() and pop_front() for dequeue()<br />
<br />
[http://nameless.cis.udel.edu/class_data/220_f2014/code/dll_list.tar Here] is starter code for a List class implemented using a doubly-linked list. ''push_back()'', ''pop_front()'' (which doesn't return anything), and ''front()'' and ''back()'' (which give access to the ends of the list without removing them) have been written for you. <br />
<br />
===1. C++ programming exercises===<br />
<br />
* '''(1 point)''' Complete the ''push_front()'' and ''pop_back()'' functions in the doubly-linked list List class. Copy ''char_test()'' and ''string_test()'' in main.cpp to ''reverse_char_test()'' and ''reverse_string_test()'' and modify them to test your functions.<br />
* '''(4 points)''' Write the ''insert_ordered()'' function (see comments in dll_list.hh for explanation) and make a new function ''ordering_test()'' in main.cpp to call it. This test function should declare a MyList<string> variable, read words from a text file specified on the command line (as with wordbyword), insert each of them into the list, and then print every element in the list from first to last. The result should be all of the words in alphabetical order.<br />
** In case it's not clear, your insert_ordered() function will need to ''traverse'' the list to find the correct spot to make a new node with the data<br />
** Please remove punctuation, make everything lower-case, etc. before running insert_ordered(). Here is a program to do this called [http://nameless.cis.udel.edu/class_data/220_f2014/code/filecleaner.tar filecleaner]. Given a file "foo.txt" on the command line, it writes a new file called "cleaned_foo.txt".<br />
<br />
===2. Submission===<br />
<br />
* Include a '''PDF file''' <Your Name>_README.pdf which contains the inputs and outputs of your program, etc. For insert_ordered(), try several different input files (such as the ones included with filecleaner), but only include outputs of shorter files.<br />
* Create a single tar/zip/rar file out of the top-level and all subdirectories. This archive file should be named <Your Last Name>_Lab4.tar (or .zip or .rar, etc.). <br />
* Submit it in Canvas by ''midnight at the end of Thursday, September 25''</div>Cer