diff --git a/Socksorting/main.pdf b/Socksorting/main.pdf index cb83ca7..c7b9adf 100644 Binary files a/Socksorting/main.pdf and b/Socksorting/main.pdf differ diff --git a/Socksorting/project.tex b/Socksorting/project.tex index 440d244..8e48b17 100644 --- a/Socksorting/project.tex +++ b/Socksorting/project.tex @@ -73,7 +73,7 @@ algorithm from the paper by \citeauthor{My colleague et al.} Which is the curren industry standard. Notice the code has a runtime complexity of $\mathcal{O}(n^2)$. \begin{algorithm} - \caption{Conventional sock sorting}\label{euclid} + \caption{Conventional sock sorting} \begin{algorithmic}[1] \State\Comment initialize a new laundry basket with a given set of laundry \State $A\gets\Lambda$\Comment WLOG assume $\forall\mathscr{L}\in\Lambda|\mathscr{L}$ is a sock @@ -121,7 +121,36 @@ obsolete. \end{figure} \section{Algorithm} +Making use of the novel advanced features of a "drying rack" we are able to +implement the following algorithm in $\mathscr{O}(n)$:\\ +\begin{algorithm} + \caption{\acronym} + \begin{algorithmic}[1] + \State\Comment initialize a new laundry basket with a given set of laundry + \State $A\gets\Lambda$\Comment WLOG assume $\forall\mathscr{L}\in\Lambda|\mathscr{L}$ is a sock + \State $\text{matches}\gets []$ + \State $\daleth\gets []$ \Comment{Create a new empty drying rack} + \Repeat + \State $\mathscr{L}\gets $ A.get + \State result $\gets$ $\daleth$.match($\mathscr{L}$) + \If{result $\ne\mathscr{L}_0$} + \State matches.append(result) + \Else + \State $\daleth$.put($\mathscr{L}$) + \EndIf + + \Until{$\mathscr{L}\ne\mathscr{L}_0$} + \end{algorithmic} +\end{algorithm} +As evident from the algorithm above, only one loop performing +operations which are all in $\mathscr{O}(1)$ is required thus +putting the algorithm in a $\mathscr{O}(n)$ runtime complexity +class. Assuming that $\forall\mathscr{L}\in\Lambda\exists\mathscr{L}^{-1}|\mathscr{L}\cong\mathscr{L}^{-1}$ +the algorithm always yields a correct solution for the problem +(proof is left as an exercise to the reader). \section{Discussion and Results} +To evaluate the algorithms performance it has been executed +on different platforms consisting of diverse hardware: \section{Conclusion}