This assignment is worth 15 points.
Next you should implement the following algorithm:
FindItemK(A,n,k)Perform a similar timing analysis on this algorithms.
- for i<-0 to k-1 do
- position = FindPositionOfMinimum(A,i, n)
- exchange(A[i], A[position])
- return A[k-1]
Finally, recompile your programs on cslab103 and redo your timing experiments on one of the algorithms.
When you are finished produce a report summarizing your results. This report should be produced using a word processor, and contain the following sections:
Algorithm 1: This algorithm finds the kth item in a list by first sorting the list then extracting the item. (place pseudo-code here)
The README file should contain personal information (your name, email, ...) as well as a description of the assignment. It should discuss the algorithms and data structures you employed in accomplishing the assignment. You should also discuss any unique features contained in your program, problems with the program, and special instructions for compiling or using your program. If you wish to provide feedback on the assignment, ask questions, or compose poetry, this is probably the place to do it.
Your makefile for this program should be derived from the following Makefile. To use this file, you should name your program alg2.C. To use this makefile, simply type make and your program should compile. By typing make clean your executables and object files will be removed. If you wish to see what commands make will issue when run you can type make -n. You can edit a make file with any editor. The file should be called Makefile with an uppercase M.
Remember, if you search the net, or a book for an algorithm, you must document the source.
To create a tar file, you should place all of the files you want to submit into a single directory, for example hw1. One level above this directory type the command:
tar cvzf hw1.tgz hw1This will create the file hw1.tgz in the current working directory. To check the contents of this file, type :
tar tzf hw1.tgzTo extract the contents of this file, type:
tar xvzf hw1.tgz
Tar is the Tape Archive utility for unix. It was originally intended to copy a file system to the tape device.