Commit ec0dd1c2 authored by Laros's avatar Laros
Browse files

Added intersection slides.

parent 0b9ff49a
......@@ -96,7 +96,7 @@
\includegraphics[height=0.8\textheight]{complexity}
}
\end{center}
\caption{}
\caption{Different complexities.}
\end{figure}
\end{pframe}
......@@ -144,8 +144,8 @@
for index, value_1 in enumerate(list_of_values):
for value_2 in list_of_values[index + 1:]:
if value_1 + value_2 > maximum:
maximum = value_1 + value_2
if f(value_1, value_2) > maximum:
maximum = f(value_1, value_2)
return maximum
\end{lstlisting}
......@@ -207,6 +207,77 @@
\begin{pframe}
Overlap of regions.
\bigskip
\begin{figure}[]
\begin{center}
\fbox{
\begin{picture}(100, 20)
\linethickness{2pt}
\put(10, 15){\line(1, 0){10}}
\put(25, 15){\line(1, 0){15}}
\put(55, 15){\line(1, 0){15}}
\put(85, 15){\line(1, 0){10}}
\put(5, 10){\line(1, 0){25}}
\put(35, 10){\line(1, 0){10}}
\put(60, 10){\line(1, 0){5}}
\put(75, 10){\line(1, 0){5}}
\onslide<2->{\color{yellow}
\put(10, 5){\line(1, 0){10}}
\put(25, 5){\line(1, 0){5}}
\put(35, 5){\line(1, 0){5}}
\put(60, 5){\line(1, 0){5}}
}
\end{picture}
}
\end{center}
\caption{Intersection of two sets of regions.}
\end{figure}
lajlkfj
\end{pframe}
\begin{pframe}
\begin{figure}[]
\begin{center}
\begin{tabular}{lllll}
& Region 1 & Region 2 & & Overlap\\
\hline
\onslide<2-5>{$\rightarrow$} & $(10, 20)$ & $(5, 30)$ &
\onslide<2,6,10,14>{$\leftarrow$} & \onslide<2->{$(10, 20)$}\\
\onslide<6-9>{$\rightarrow$} & $(25, 40)$ & $(35, 45)$ &
\onslide<3,7,11,15>{$\leftarrow$} & \onslide<6->{$(25, 30)$}
\onslide<7->{$(35, 40)$}\\
\onslide<10-13>{$\rightarrow$} & $(55, 70)$ & $(60, 65)$ &
\onslide<4,8,12,16>{$\leftarrow$} & \onslide<12->{$(60, 65)$}\\
\onslide<14-17>{$\rightarrow$} & $(85, 95)$ & $(75, 80)$ &
\onslide<5,9,13,17>{$\leftarrow$} & \\
\end{tabular}
\end{center}
\caption{$\mathcal{O}(n^2)$: $16$ steps.}
\end{figure}
Notice that interesting things happen only when the arrows are close.
\end{pframe}
\begin{pframe}
\begin{figure}[]
\begin{center}
\begin{tabular}{lllll}
& Region 1 & Region 2 & & Overlap\\
\hline
\onslide<2>{$\rightarrow$} & $(10, 20)$ & $(5, 30)$ &
\onslide<2,3>{$\leftarrow$} & \onslide<2->{$(10, 20)$}\\
\onslide<3,4>{$\rightarrow$} & $(25, 40)$ & $(35, 45)$ &
\onslide<4,5>{$\leftarrow$} & \onslide<3->{$(25, 30)$}
\onslide<4->{$(35, 40)$}\\
\onslide<5,6,7>{$\rightarrow$} & $(55, 70)$ & $(60, 65)$ &
\onslide<6>{$\leftarrow$} & \onslide<6->{$(60, 65)$}\\
\onslide<8>{$\rightarrow$} & $(85, 95)$ & $(75, 80)$ &
\onslide<7,8>{$\leftarrow$} & \\
\end{tabular}
\end{center}
\caption{$\mathcal{O}(n)$: $7$ steps.}
\end{figure}
\end{pframe}
\section{Combining languages}
......@@ -284,6 +355,43 @@
\end{figure}
\end{pframe}
\section{Data structures}
\subsection{Simple solutions for simple problems}
\begin{pframe}
In general, use the simplest data structure that suits your needs.
\begin{itemize}
\item Complicated data structures have more overhead.
\end{itemize}
\bigskip
Note that simplest is not always the \emph{easiest}.
\end{pframe}
% Hash vs. matrix.
\begin{pframe}
A \emph{dictionary} or \emph{hash}.
\begin{itemize}
\item Very fast data structure for \emph{key-value pairs}.
\end{itemize}
But if you have keys ranging from $0$ to $n$, use a simple \emph{list} or
\emph{array}.
\end{pframe}
\subsection{Sets}
\begin{pframe}
\begin{lstlisting}[language=python, caption={Find gene names in some text.}]
for word in text:
for gene in genes:
if word == gene:
print word
\end{lstlisting}
\begin{lstlisting}[language=python, caption={Find gene names in some text.}]
print set(text) & set(genes)
\end{lstlisting}
\end{pframe}
\section{Parallelisation}
% Parallelisation (last resort).
%
......@@ -296,8 +404,6 @@
\bigskip
\bigskip
Perhaps acknowledge the author of this template.
\end{center}
\end{pframe}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment