Project 05
Home ] Up ]

 

CSIS 250 Fall 2000 Project #5

 

Course

CSIS 250-01

Semester

Fall 2000

Date Assigned

October 25, 2000

Date Due

November 3, 2000

Develop the bubbleSort function and support functions (swap, populate, display) for an array of integers with a main program in C++.   The sort function should keep track of the counts used to measure the efforts required by it due to the following actions:

§           Assignment

§           Compare

§           Add

§           Increase

§           Any other operation

The main program should test lists of sizes 10, 20, 30, 40, and 50.

Submit the printed algorithms, source code, output, and the self-evaluation sheet.

You can use the following algorithm for the main driver as a guide.

 

do the following for n=10 to 50 step 10

  populate a[0..n-1] with n random values

  Initialize count to zero

  display “original”, n, count, a[0..n-1]

  bubbleSort(a, n)

  display “sorted”, n, count, a[0..n-1]

  end do

 

 

SELF-EVALUATION SHEET PROJECT #5

Function/output

Max Score

Your Score

algorithms

10

 

bubbleSort

10

 

display

10

 

main

10

 

populate

10

 

swap

10

 

test runs

10

 

 

 

 

Total Score

70