CSE 222 Closed Lab #2
Please follow these steps in closed lab:
-
Select a partner to work with on the closed lab exercise and decide whose
account to use for it. After you have completed the closed lab exercise,
the person whose account has been used may e-mail to his/her partner the
file(s) containing the solution that was devised by the partnership.
-
Copy the initial closed lab #2 files to your own working directory and get
into that directory:
cp -R /class/sce/now/222/closed-labs/closed-lab02/Closed_Lab02/ .
cd Closed_Lab02
- Look through the file Sort_Test.cpp,
which is a test driver for a Sort extension for Queue_Kernel
<Text>,
just to get an idea of the overall structure and to see what main does.
-
Now select and edit the file CT/Queue_Of_Text/Sort_1.h. Fill
in the body of the private operation
Remove_Min, which you should
have done as the homework; it was a global operation there but the body
is identical. Then, while in the emacs buffer for Sort_Test.cpp,
execute the "Build Project" command to compile the file.
-
Back in the Sort_1.h buffer, fill in the body of the Sort operation.
Here the code is slightly different from what you wrote on the homework,
because Sort here is an extension and the queue being sorted is called
self,
not q. Then, while in the emacs buffer for Sort_Test.cpp,
again execute the "Build Project" command to compile the file. This
time, run the program. If you're looking for some interesting input,
try redirecting input from the file
lines.txt.
-
Let your instructor know when you are satisfied both operations work satisfactorily,
in order to get credit for this closed lab.