A1P1_ENGR215_F08 - 4. Try the solution strategy "by...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Engineering ENGR 215 College of San Mateo L. Demsetz Assignment 1: Getting Started Part 1 – Algorithms Due Saturday, August 23 by e-mail. Submit your work in a .doc, .docx, or .txt file (or other text file) with file name YourName_ENGR215_A1. Send it as an attachment to an e-mail to demsetz@smccd.edu. The subject line should read as follows YourName_ENGR215_A1 where YourName is your name (first and last) and A1 is assignment 1. So if I were submitting this assignment and had saved it in a file created with MS Word, the file name would be LauraDemsetz_ENGR215_A1.doc and the subject line in the e-mail message would be LauraDemsetz_ENGR215_A1. In the first lecture, the following steps for problem solving were introduced. 1. Recognize and understand the problem (state assumptions). 2. Identify the inputs and outputs. 3. Develop a solution strategy.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4. Try the solution strategy "by hand". 5. Implement the solution strategy (write the code). 6. Run test cases. 7. Run the code. Apply steps 1-4 to the two problems below. Be sure to consider each step in the solution strategy; don’t take anything for granted! Do not refer to software or standard sorting algorithms (you’re not expected to know these yet). 1. You are teaching a class and want to break the class into groups of 4 for a project. How will you assign the students to groups? 2. Develop an algorithm that takes a list of integers and reorders them so that the smallest number is first, the largest number is second, the next-to-smallest is third, the next-to-largest is fourth, and so on. If the original list contained [5, 8, 12, 10, 2, 7, 4], after applying your algorithm, the list would contain [2, 12, 4, 10, 5, 8, 7]....
View Full Document

This document was uploaded on 10/07/2008.

Ask a homework question - tutors are online