\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm,enumitem}

\usepackage[margin=1in]{geometry}

\title{\bf Assignment 3 \\[2ex]
\rm\normalsize CS 350 \\ Due: October 28, 2019}
\date{}
\author{}

\begin{document}
\maketitle

\begin{center}
    \fbox{\fbox{\parbox{5.5in}{\centering
    Your solutions must be typed (preferably typeset in \LaTeX ) and submitted as a hard-copy at the beginning of class on the day its due. The answers that you provide should clearly demonstrate that you understand the assignment and should provide enough information to clearly explain your solution to a peer.
    When asked to provide an algorithm you need to give well formatted pseudocode and a description of how your code solves the problem.
    }}}
\end{center}

\paragraph{Problem 1 [10 points]}
Suppose that two arrays of $n$ unique integers, $A$ and $B$ are in sorted order. Give an algorithm that will find the median value of $A \cup B$ in $O(\log n)$ time.

\paragraph{Problem 2}
In the programming language of your choice, implement both Insertion Sort and Merge Sort as described in class. Feel free base your code on implementations that you find online, just ensure that both operate on similar objects and properly cite your sources. Add code to both algorithms that tracks the time it takes to process an input. You will also need to create a method that generates arrays of integers of various sizes and orderings. (Your submission for this question does not need to contain the code, but you must be able to provide that code upon request)

\subparagraph{(a) [10 points]} Run your algorithms on various sized lists of random integers and graph the running time. Does your graph match the theoretical analysis we did in class, explain why or why not? (Try to get to the point where the slower of the two algorithms finishes in more than one second.)

\subparagraph{(b) [10 points]} Repeat part $(a)$ using already sorted lists of integers.  Graph and explain your results.

\subparagraph{(c) [10 points]} Choose a list size and experimentally determine the numer of array elements that can be out of order before Insertion sort is not longer the faster option. Graph and explain your results.

\end{document}
