# HG changeset patch # User Christian Urban # Date 1572729822 0 # Node ID 3c7ac7836e4f331acd38aa03c8c96cbf94b82ff3 # Parent 1877cc717291afcf2e94c14c0303253b9ed24be3 updated diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw01.pdf Binary file cws/cw01.pdf has changed diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw02.pdf Binary file cws/cw02.pdf has changed diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw03.pdf Binary file cws/cw03.pdf has changed diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw03.tex --- a/cws/cw03.tex Sat Nov 02 19:07:19 2019 +0000 +++ b/cws/cw03.tex Sat Nov 02 21:23:42 2019 +0000 @@ -191,7 +191,7 @@ \subsection*{Hints} \noindent -\textbf{Part 1} useful list functions: \texttt{.contains(..)} checks +\textbf{Preliminary Part} useful list functions: \texttt{.contains(..)} checks whether an element is in a list, \texttt{.flatten} turns a list of lists into just a list, \texttt{\_::\_} puts an element on the head of the list, \texttt{.head} gives you the first element of a list (make @@ -202,7 +202,7 @@ \noindent -\textbf{Part 2} a useful list function: \texttt{.sortBy} sorts a list +\textbf{Core Part} a useful list function: \texttt{.sortBy} sorts a list according to a component given by the function; a function can be tested to be tail-recursive by annotation \texttt{@tailrec}, which is made available by importing \texttt{scala.annotation.tailrec}.\medskip @@ -345,7 +345,7 @@ %%\newpage - +\noindent As you should have seen in the earlier parts, a naive search for tours beyond $8 \times 8$ boards and also searching for closed tours even on small boards takes too much time. There is a heuristic, called \emph{Warnsdorf's diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw04.pdf Binary file cws/cw04.pdf has changed diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw04.tex --- a/cws/cw04.tex Sat Nov 02 19:07:19 2019 +0000 +++ b/cws/cw04.tex Sat Nov 02 21:23:42 2019 +0000 @@ -94,7 +94,7 @@ % BF IDE % https://www.microsoft.com/en-us/p/brainf-ck/9nblgggzhvq5 -\section*{Coursework 9 (Scala)} +\section*{Part 9 (Scala)} \mbox{}\hfill\textit{``[Google’s MapReduce] abstraction is inspired by the}\\ \mbox{}\hfill\textit{map and reduce primitives present in Lisp and many}\\ @@ -103,7 +103,7 @@ \bigskip\medskip \noindent -This coursework is about the shunting yard algorithm by Dijkstra and a +This part is about the shunting yard algorithm by Dijkstra and a regular expression matcher by Brzozowski. The preliminary part is due on \cwNINE{} at 4pm; the core, more advanced part, is due on \cwNINEa{} at 4pm. The preliminary part is about the Shunting Yard Algorithm that diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw05.pdf Binary file cws/cw05.pdf has changed diff -r 1877cc717291 -r 3c7ac7836e4f cws/cw05.tex --- a/cws/cw05.tex Sat Nov 02 19:07:19 2019 +0000 +++ b/cws/cw05.tex Sat Nov 02 21:23:42 2019 +0000 @@ -13,7 +13,7 @@ \begin{document} -\section*{Coursework 10 (Scala)} +\section*{Part 10 (Scala)} \mbox{}\hfill\textit{``If there's one feature that makes Scala,}\\ \mbox{}\hfill\textit{`Scala', I would pick implicits.''}\smallskip\\ @@ -21,8 +21,8 @@ \noindent -This coursework is about a small programming -language called brainf***. The coursework is worth 10\% and you need to +This part is about a small programming +language called brainf***. The part is worth 10\% and you need to submit on \cwTEN{} at 4pm.\bigskip \IMPORTANT{} @@ -85,7 +85,7 @@ \newpage -\subsection*{Part 1 (6 Marks)} +\subsection*{Part A (6 Marks)} Coming from Java or C++, you might think Scala is a rather esoteric programming language. But remember, some serious companies have built @@ -334,7 +334,7 @@ %%\newpage -\subsection*{Part 2 (4 Marks)} +\subsection*{Part B (4 Marks)} I am sure you agree while it is fun to look at bf-programs, like the Sierpinski triangle or the Mandelbrot program, being interpreted, it