\title{A4: List vs Vector} \input{preamble.tex} I wanted to experiment with co-routine generator for the random numbers but discovered the \texttt{std::generator} is not supplied with my compiler. Instead I found what seemed like a similar implementation here: \texttt{https://en.cppreference.com/w/cpp/language/coroutines}, which I have copied to the \texttt{generator.h} file for use in my program. I am aware that the random number generator already kind-of works similarly to a co-routine generator seen from the outside, so the whole experiment is a bit pointless from a software design perspective. For this exercise I also re-designed my measurement tool from the previous assignments to better support re-use of data across measurements. And, finally, I made a class for storing and outputting measurement points as octave/matlab programs for easier inclusion into the report. This I put in its own file \texttt{octave.cc} with corresponding header \texttt{octave.h}. It is by no means very clever, but made to suit my needs for this assignment. \bigskip The random number generation for use in insertion I used the co-routine as described above, inserting, while checking if the number already exists. For the ditto for removal indices, I used a \texttt{uniform\_distribution} thereby being able to gradually reduce the span as the container would be expected to shrink 1 in size for each iteration. Both random number generators were seeded with the iterator number (each size is being tested three times) to make sure the three iterations use unique sets of numbers. For the smaller sizes of \texttt{N} (the number of items to be inserted/removed) i print out the numbers to verify their correctness. \begin{figure} \includegraphics[scale=0.95]{a4/insert.pdf} \caption{Insert of int} \label{insert} \end{figure} \begin{figure} \includegraphics[scale=.95]{a4/remove.pdf} \caption{Removal of int} \label{remove} \end{figure} \begin{figure} \includegraphics[scale=0.95]{a4/insert-padded.pdf} \caption{Insert of padded-int (1024 bytes pr. value)} \label{insert-padded} \end{figure} \begin{figure} \includegraphics[scale=.95]{a4/remove-padded.pdf} \caption{Removal of padded-int (1024 bytes pr. value)} \label{remove-padded} \end{figure} \end{document}