CSE 331 Spring 2018 Homework 0

CSE 331 Spring 2018

Homework 0

Due: Friday, March 30 by 5 PM

No late submissions will be accepted.

Write an algorithm to partition the elements of an integer array as described below and argue that your algorithm is correct. You should not run your algorithm or debug it on a computer. The idea of the exercise is to get it right by thinking and analyzing, not by executing, debugging, trial-and-error, or experimenting.

Use Java syntax for your code, but do not write an entire Java program; just one method. Because you are not using a computer we will not grade on tiny syntax mistakes like forgetting a semicolon, but do your best to write a clear and correct algorithm.

Your algorithm should work as follows:

When you are done, you should upload a pdf file containing your answer to gradescope. The file should contain:

Gradescope will ask you identify which problems are contained on which pages; just select the page with your solution.

Be sure that your name appears at the top of your solution.

Note: gradescope accounts will be created on the first or second day of the quarter for all registered students. You will receive an email message from gradescope with a link you can use to access the turnin page, or you can follow the link on the course home page. If you are not registered for the course before the assignment is due, please send mail to cse331-staff[at]cs with your name and UW ID number so we can set up a gradescope account for you.

Note: Your solution file must be in PDF format, but it is ok to submit a scanned copy of a handwritten document as long as it is legible when printed and the total file size is no larger than 2-3 MB or so. But be sure it is legible - photographs taken with a phone are very often not adequate compared to a scanned document.