\documentclass[11pt,a4paper]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{hyperref}

\title{Data Structures and Algorithms\\Assignment 1 -- Answer Sheet}
\author{First name Last name\\Matriculation number:}
\date{}

\newcommand{\arraygrid}{
\begin{tabular}{@{}|*{10}{c|}@{}}
\hline
0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
 & & & & & & & & & \\
\hline
\end{tabular}
}

\begin{document}
\maketitle

\section*{Exercise 1: Analysis of quick-find}
\begin{center}
\scriptsize
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|c|c|c|}
\hline
Step & \texttt{id[]} before & \texttt{id[]} after & Array accesses \\
\hline
\texttt{union(9,0)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(3,4)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(5,8)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(7,2)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(2,1)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(5,7)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(0,3)} & \arraygrid & \arraygrid & \\
\hline
\texttt{union(4,2)} & \arraygrid & \arraygrid & \\
\hline
\end{tabular}
}
\end{center}

\section*{Exercise 2: Analysis of quick-union}
Write your answer here.

\section*{Exercise 3: \texttt{union()} implementation}
Write your answer here.

\section*{Exercise 4: Weighted quick union}
Write your answer here.

\end{document}
