day2/tda.tex
changeset 76 b24c2560f626
parent 62 12bd6784d213
child 97 555237dbce44
equal deleted inserted replaced
75:090d03e43e95 76:b24c2560f626
   259 %\end{frame}
   259 %\end{frame}
   260 %
   260 %
   261 
   261 
   262 \begin{frame}[fragile]
   262 \begin{frame}[fragile]
   263     \frametitle{Exercise}
   263     \frametitle{Exercise}
   264     Based on Euclid's theorem:
   264     Based on Euclid's algorithm:
   265         $gcd(a,b)=gcd(b,b\%a)$\\
   265         $gcd(a,b)=gcd(b,b\%a)$\\
   266     gcd function can be written as:
   266     gcd function can be written as:
   267     \begin{lstlisting}
   267     \begin{lstlisting}
   268     def gcd(a, b):
   268     def gcd(a, b):
   269       if a%b == 0: return b
   269       if a%b == 0: return b
   270       return gcd(b, a%b)
   270       return gcd(b, a%b)
   271     \end{lstlisting}
   271     \end{lstlisting}
       
   272     \vspace*{-0.15in}
   272     \begin{block}{Task}
   273     \begin{block}{Task}
   273       For given gcd implementation write
   274       \begin{itemize}
   274       at least two tests.
   275       \item Write at least 
   275     \end{block}
   276         two tests for above mentioned function.
   276     \begin{block}{Task}
   277       \item Write a non recursive implementation
   277       Write a non recursive implementation
       
   278       of gcd(), and test it using already 
   278       of gcd(), and test it using already 
   279       written tests.
   279       written tests.
       
   280       \end{itemize}
   280     \end{block}
   281     \end{block}
   281     
   282     
   282 \inctime{15} 
   283 \inctime{15} 
   283 \end{frame}
   284 \end{frame}
   284 
   285