%---------
% place your email id between the braces so that your homework has a name
\def\yourname{}
% -----------------------------------------------------
\def\duedate{7/21/2025}
\def\duelocation{via \href{https://www.gradescope.com/courses/1007022}{Gradescope}}
\def\hnumber{3}
\def\prof{Konstantinos Ameranis}
\def\course{\href{https://canvas.uchicago.edu/courses/64693}{CMSC 14300 - Summer 2025}}
%-------------------------------------

\documentclass[10pt]{article}
\usepackage[colorlinks,urlcolor=blue]{hyperref}
\usepackage[osf]{mathpazo}
\usepackage{amsmath,amsfonts,graphicx}
\usepackage{latexsym}
\usepackage{subfig}
\usepackage{algpseudocode}
\usepackage[shortlabels]{enumitem}
\usepackage{algorithm}
\usepackage{listings}
%\usepackage[top=1in,bottom=1.4in,left=1.5in,right=1.5in,centering]{geometry}
\usepackage{fullpage}
\usepackage{color}
\definecolor{mdb}{rgb}{0.3,0.02,0.02}
\definecolor{cit}{rgb}{0.05,0.2,0.45}
%\pagestyle{myheadings}
\markboth{\yourname}{\yourname}

\thispagestyle{empty}

\newenvironment{proof}{\par\noindent{\it Proof.}\hspace*{1em}}{$\Box$\bigskip}
\newcommand{\qed}{$\Box$}
\newcommand{\alg}[1]{\mathsf{#1}}
\newcommand{\handout}{
   \renewcommand{\thepage}{H\hnumber-\arabic{page}}
   \noindent
   \begin{center}
      \vbox{
    \hbox to \columnwidth {\sc{\course} --- \prof \hfill}
    \vspace{-2mm}
    \hbox to \columnwidth {\sc due \MakeLowercase{\duedate} \duelocation\hfill {\Huge\color{mdb}H\hnumber.\yourname}}
      }
   \end{center}
   \vspace*{2mm}
}
\newcommand{\solution}[1]{
\vspace{2mm}

\noindent Collaborators:

\vspace{5mm}

\medskip\noindent{\color{cit}\textbf{Solution:} #1}}

\newcommand{\bit}[1]{\{0,1\}^{ #1 }}
\newcommand{\extraspace}{\medskip\noindent{\color{cit} Extra space for your solution}\newpage}
%\dontprintsemicolon
%\linesnumbered=
\newtheorem{problem}{\sc\color{cit}Problem}
\newtheorem{lemma}{Lemma}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}
\newtheorem{claim}{Claim}


\begin{document}
\handout

\begin{problem}[Array vs linked list]
Comparing array lists and linked lists, for each of the following list
operations, which one typically runs faster? Answer one of array lists,
linked lists, or roughly the same.

\begin{enumerate}[(a)]
    \item {\tt append}
    \vfill

    \item {\tt prepend}
    \vfill

    \item {\tt len}
    \vfill

    \item {\tt insert\_at}
    \vfill

    \item {\tt remove\_at}
    \vfill

    \item {\tt is\_empty}
    \vfill

    \item {\tt at}
    \vfill
\end{enumerate}

\end{problem}
\newpage
\begin{problem}
Comparing array lists and linked lists, which one would be more appropriate for each of the following usage? Why?

\begin{enumerate}[(a)]
    \item A browser's back and forward buttons. Frequent addition and removal of URLs would occur at both ends.
    \vfill

    \item Spotify (or similar online music streaming services) Playlist, where random access is needed to play any song in the playlist and needs to be able to play on shuffle.
    \vfill

    \item A text editor where characters are frequently inserted or removed in the middle of the text.
    \vfill
\end{enumerate}
\end{problem}

\begin{problem}
How many hours did you spend for this assignment?
\vfill    
\end{problem}

\begin{problem}
What is the most difficult aspect of this assignment, if any?
\vfill
\end{problem}

\begin{problem}
Document your collaboration here.
\vfill    
\end{problem}
\end{document}                                                                                                                                                                                                

