next up previous
Next: About this document ...

Milestone #6
CpSc 481/681: Skills for Visual Computing
School of Computing
Clemson University
Solving Problems with C
Arrays
Brian Malloy, PhD
November 20, 2009



The purpose of this milestone is to help you to become familiar with using arrays in the C language, where an array is a sequence of contiguous memory locations and we access each location using a subscript. Use a one dimensional array to solve the first problem below, and a two dimensional array to solve the second problem.

  1. Selection Sort: In lecture, we studied the problem of finding the largest element in an array. Use this technique to sort an array by finding the largest element, placing it in the last location of the array, then finding the next to largest element and placing that element in the next to last location of the array, and so forth, until the array is sorted. Think about the differences between bubble sort and selection sort.

  2. Create an image with characters: Using a two-dimensional array of characters, fill an array and then print the array so that a recognizable image is printed on the screen.

Please make a directory for each of the assignments and, in each directory, place a Makefile so that I can go to that directory, make your solution, and execute it. Please make a directory called and in this directory place two subdirectories: sort and picture. In the sort directory, place two files: a Makefile and your main program. In the picture directory, place three files: a Makefile, your main program, and the output from your program. I'll show you how to send your output to a file. To submit your assignment, simply compress your outer directory using either of the following commands:

        zip -r 6.zip 6
        tar -zcvf 6.tar.gz 6

Your assignment must be submitted, using the handin command, by 8 AM on Wednesday, November 25th, 2009. Please compress the directory that contains your C programs and include a readme that contains your name, the course number, and an explanation of the submissions and the filenames.

And the syntax for the handin command is:

        handin.481.1 6 6.tar.gz (or 6.zip)

Where handin.481.1 means that you are using the handin command for CpSc 481, Section 1. The means that this is the sixth milestone and 6.tar.gz is the name of the directory that you compressed using tar.

Good luck with the assignment, and I hope that this milestone helps you to become more comfortable with the C Programming Language.




next up previous
Next: About this document ...
Brian Malloy 2009-11-20