cws/cw02.tex
changeset 259 43995ea34fe7
parent 251 3dd550b9b0e3
child 264 ecd989eee8bd
equal deleted inserted replaced
258:ebe71908b13e 259:43995ea34fe7
   232 \subsection*{Tasks}
   232 \subsection*{Tasks}
   233 
   233 
   234 \begin{itemize}
   234 \begin{itemize}
   235 \item[(3)] Implement a kind of grouping function that calculates a Map
   235 \item[(3)] Implement a kind of grouping function that calculates a Map
   236   containing the userIDs and all the corresponding recommendations for
   236   containing the userIDs and all the corresponding recommendations for
   237   this user (list of movieIDs). This should be implemented in a tail
   237   this user (list of movieIDs). This should be implemented in a
   238   recursive fashion using a Map as accumulator. This Map is set to
   238   tail-recursive fashion using a Map as accumulator. This Map is set to
   239   \pcode{Map()} at the beginning of the calculation. For example
   239   \pcode{Map()} at the beginning of the calculation. For example
   240 
   240 
   241 \begin{lstlisting}[numbers=none]
   241 \begin{lstlisting}[numbers=none]
   242 val lst = List(("1", "a"), ("1", "b"),
   242 val lst = List(("1", "a"), ("1", "b"),
   243                ("2", "x"), ("3", "a"),
   243                ("2", "x"), ("3", "a"),