\documentclass[12pt]{article}

\usepackage{amsmath,amsfonts}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{tikz}

% Packages for Pseudocode
\usepackage{verbatim}
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}
\DontPrintSemicolon
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}

\usepackage{fullpage,url,amssymb,epsfig,color,xspace}
\usepackage[pdftitle={CS240 Tutorial 0},%
pdfsubject={University of Waterloo, CS240, Winter 2026},%
pdfauthor={}]{hyperref}

\renewcommand{\thesubsection}{Problem \arabic{subsection}}

% UP there is the preamble

%\commandname[opt, args]{reqd, args}

%\begin{envirname}
%	stuff
%\end{envirname}

% Add new commands/macros like so
\newcommand{\Z}{{\mathbb{Z}}}

\begin{document}

\begin{center}
{\Large\bf University of Waterloo}\\
\vspace{3mm}
{\Large\bf CS240 Winter 2026}\\
\vspace{2mm}
{\Large\bf Tutorial 00}
\end{center}

\definecolor{care}{rgb}{0,0,0}
\def\question#1{\item[\bf #1.]}
\def\part#1{\item[\bf #1)]}
\newcommand{\pc}[1]{\mbox{\textbf{#1}}}

% _ underscore below
% ^ caret above

\section{Mathematics}

Write a proof showing that for any integer $b$, we have $ab=0, \forall a\in\Z \implies b = 0$. \\

\section{Trees}
We will add the letters Z, A, and B to the BST below. \\
\begin{center}\begin{tikzpicture}[
  level distance=45 pt,
  every node/.style={circle,draw},
  level 1/.style={sibling distance=200 pt},
  level 2/.style={sibling distance=100 pt},
  level 3/.style={sibling distance=60 pt}
]
  \node {M$_{0}$}
    child {node {F$_{0}$}
      child {node {C$_{0}$}}
      child {node {I$_{0}$}}
    }
    child {node {T$_{0}$}
      child {node {Q$_{0}$}}
      child {node {W$_{0}$}}
    };
\end{tikzpicture}\end{center}

{\it Hint: For nodes with only one child, you may wish to use ``child[missing]'' for the non-existent child.}

\section{Pseudocode}

The following code segment does not properly swap A and B. Make adjustments to correct it.
\begin{algorithm}[ht]
\caption{\emph{swap}($A, B$)}
\Input{$A$ and $B$ are object references}
\If {$A = B$} {
    return \;
}
\Else {
    $A \gets B$ \;
    $B \gets A$ \;
}
\end{algorithm}
% Other useful commands: \uElseIf, \For, \While

% \newpage splits the content so that everything after comes on a new page in the pdf
\newpage

\section{Tables}
The following table is incomplete. Add an additional row to fill in the missing information (if you don't know what should be in the last row, put whatever you want). 
 \begin{center}
     
\begin{tabular}{ | l | c || r | } 
  \hline
  Bulbasaur & Ivysaur & Venusaur  \\ 
  \hline
  Charmander & Charmeleon & Charizard \\ 
  \hline
\end{tabular}

 \end{center}
% Items in the table are separated by &
% \hline generates the horizontal line
% "\\" is a newline
% l, c, r makes the text left, centre, and right-aligned

\section{Images}
Uploading an image can sometimes be easier to display your work. Take a screenshot, then upload it to your project and display it below.

\begin{figure}[tbhp]
	\begin{center}
		\includegraphics[width=0.5\textwidth]{replace.png}
	\end{center}
	\caption{Placeholder Text}
	\label{figcaption}
\end{figure}

\section{Latex Resources}
 \LaTeX\ Editors

 \begin{enumerate}[a)]
 \item{TeX Live: \url{https://www.tug.org/texlive/}}
 \item{TeXstudio: \url{https://www.texstudio.org/}}
 \item{Overleaf: \url{https://www.overleaf.com/}}
 \item{pdflatex: on the student environment}
 \end{enumerate} 
 \bigskip
 
 Miscellaneous Resources
 \begin{itemize}
 \item{\url{http://detexify.kirelabs.org/classify.html}}
 \item{\url{https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols}}
 \item{\url{https://en.wikibooks.org/wiki/LaTeX}}
 \item{\url{https://tex.stackexchange.com/}}
 \end{itemize}

\end{document}