cws/cw02.tex
changeset 259 77c3bd7a0670
parent 251 a0bd77103898
child 264 25f3fbc43251
equal deleted inserted replaced
258:41c4f7d85f59 259:77c3bd7a0670
   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"),