Instructions

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 2

DownloadInstructions
Open PDF In BrowserView PDF
5/28/2019

Lab 3

Lab 3
Due Mar 9 by 8am
Points 10
Available until Mar 9 at 8am

Submitting a file upload

File Types pdf and tgz

This assignment was locked Mar 9 at 8am.
For this lab we are comparing the timing of three algorithms. Typically, to find a median, we would sort the data, then
select the middle element.
Implement this first using the built in sort algorithm, then using quicksort, then compare the time those take in
milliseconds with this idea for select:

Run your program using a small array to test that each algorithm works using Catch2 unit tests.
Then use a very large array of numbers until it takes at least some milliseconds. Otherwise you can't see any
difference in the timings!

Run your program with the options
-s -d yes -r compact -o results

to capture the output into the results text file and include it using the \VerbatimInput command.
Add comments to the select function of your program explaining what the function does and how it manages to find
the median. The idea is to help the reader understand the code so do not simply paraphrase the code, but instead add
explanations with illustrations and/or drawings clarifying the change of state that the program produces.

If you use ddd to create the illustrations, you can save them as .ps files, then use the convert command:
mogrify -format png *.ps

https://ohlone.instructure.com/courses/6963/assignments/142355

1/2

5/28/2019

Lab 3

to create images that can be included in the pdf file.

If you use gdb from console, you can
set logging file gdboutput
set logging overwrite on
set logging on
show logging

then include gdboutput using \VerbatimInput.
or you could use the verbatim environment to enclose outputs that you pasted from one of these log files.
\begin{verbatim}
....
\end{verbatim}

In either case, you still must annotate or somehow explain the meaning of the data.
Document readers are not mind-readers!
Add a summary page where you comment about the differences in timings between the 3 algorithms.
Use cpp2pdf to create the PDF that will have all source, code, images and comments nicely formatted and easy to
read. Use the Latex \newpage command where needed to make logical breaks in the program structure.
Save your work by using this command in the working directory (lab3), retrieve the tgz and pdf file using the web
server, and upload and submit to Canvas.

https://ohlone.instructure.com/courses/6963/assignments/142355

2/2



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 2
Creator                         : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Producer                        : Skia/PDF m74
Create Date                     : 2019:05:28 07:58:13+00:00
Modify Date                     : 2019:05:28 07:58:13+00:00
EXIF Metadata provided by EXIF.tools

Navigation menu