Pens/pencils and a math calculator along with this exampaper are only allowed on the table. No scratch paper; use the rear of an exam page that is blank and mark it properly. Do not detach pages of this exampaper. ALERT: Mobile phones, devices, including wearables connected to phones (e.g. iwatch, hearing aids or attachments) SHOULD NOT BE ON YOU. They must be powered down (equivalent to removing the battery) and put securely in a backpack or bag that should be closed/zippered. Read the Syllabus clause on devices. FOOD/DRINKS are not allowed per NJIT regulations. NOTE: Give an algorithm means, present the algorithm (pseudocode or english), show that it works as claimed, and analyze its running time by providing an asymptotically tight bound or as instructed. In some cases, you may be asked explicitly to provide a tight exact answer in terms of a fundamental operation. Efficient means an algorithm whose performance (space or time or both) cannot be improved upon asymptotically. Time efficient means asymptotic time efficiency cannot be improved upon. Space efficiency is to be interpreted likewise. Comparison efficient means the number of comparisons cannot be improved upon and thus constants are important for higher-order terms: thus $\Theta (n)$ is worse than $3n$, and $3n$ is worse than say $2n+o(n)$. Use T(.) for running time, S(.) for space resources, and C(.) for comparison counts with the choice of parameter(s) as needed. } $INCR = \langle 1, 2, ... , n-1, n \rangle$ is the sorted sequence of the first n positive integers starting with 1. $DECR = \langle n, n-1, ... , 2, 1 \rangle$ is the reverse sorted sequence of the first n positive integers starting with n. CLASS RESUMES FIVE MINUTES after EXAM PICK-UP