Anne Dawson: CSCI201A_LAB1_FA04.htm   

 

Last updated: Thursday 9th September 2004, 6:11 PT

 

This document is subject to change without notice.

 

Please report any errors or omissions in this document:

adawson@coquitlamcollege.com

 

Special instructions:  For this assignment you may work in teams of 2, or alone.

This lab is due at the end of the lab session.

 

Lab 1 Specification:

-------------------

 

This lab is due at the end of the lab session (12:05pm today).

 

The objective of this lab is to investigate the affect of size of

an array of integers on the time taken to sort it.

 

Using an insertion sort program (you can write your own program,

use textbook code, or code obtained from the Internet),

time how long it takes to sort arrays of different sizes.

 

C++ and Java both provide a function/method to obtain system time.

By using this method at the start and end of your sort routine,

you can estimate the time taken to complete the sort.

 

Based on the results of your timing experiments, suggest a Big Oh

complexity (O(n), O(n2), O(log n) etc) for the insertion sort algorithm.

Place your Big Oh prediction in a comment at the top of the code.

 

Name your source code file lab1.cpp or lab1.java

 

Ensure that the following (completed) header is present at the top of your code:

 

// File:           [lab1.cpp][lab1.java]

// Date:           Thursday 9th September 2004, N:NN PT

// Programmer1:

// Programmer2:

// Course:         CSCI201A

// Lab Code:       Lab 1

// Assignment:     Estimation of Running Time for Insertion Sort Program

// Status:         [Complete][Incomplete]

// Conclusion:     Big Oh complexity =

 

Submission instructions:

-----------------------

 

At the end of the lab session you should save just your source code file to your folder in CSCI201A\Week01\Lab1.

 

If you're working in a team, both team members save the same file to their own folder.

 

Make sure that you include your name/s, the date and filename in comments at the top of the code.

 

 

 

Marking Scheme :

--------------

 

The following marking scheme applies:

 

 

Course Code:      CSCI201A

Semester:         FA04

Assignment Code:  Lab1

Instructor Name:  Dr Anne Dawson

 

Assignment: Estimation of Running Time for Insertion Sort Program

 

Student1 Name:

Student1 Number:

[Student2 Name:]

[Student2 Number:]

 

 

DESIGN

 

1.  The program has appropriate modularity

    i.e. functions are used where it makes sense to use them.   /10

                       

2.  Appropriate data types are used.                            /10

 

3.  Appropriate control structures are used

    (i.e. loops and decisions).                                 /10

 

4.  The User Interface (output to the screen) is

    clear and tidy.                                             /10

 

MAINTAINABILITY

 

5.  The program is commented appropriately - including

    date, filename and pre- and post-condition     

    comments                                                    /10

 

6.  The program has meaningful identifiers.                     /10

 

7.  The program is indented (spaced out) correctly, to

    aid the understanding of the code.                          /10

 

8.  The code is easy to follow.                                 /10

 

CORRECTNESS:

 

9.  The program compiles with 0 errors and 0 warnings.          /10

 

10. Big Oh complexity prediction                                /10

 

 

                                               % Complete:

                                                    Total:     /100

                                                     Date: