CS286 -- Lab 2: Sorting Algorithms



->Courses
->CS286
-->Homework
-->Quiz 1
-->Lab 1
->Lab 2
-->Lab 3
-->Lab 4
->Electronic Submission
->MSVC++ Info
->STL Info
->MFC/GUI Info
->Tentative Schedule
->Course Policies

[Courses]
[Unix][Home][Photos]
[PHome]

Spring Quarter 2000

Purpose

This lab assignment is designed to provide insight into the implementation of various sorting algorithms and generic algorithms.

Assignment

You should implement three generic sorting algorithms. You should implement InsertionSort, HeapSort, and QuickSort. One algorithm should require only bi-directional iterators while the other two may use random access iterators.

The sorting algorithms should work on any container (with the appropriate iterators available) containing any type of objects for which the less than operator is defined.

In addition, you should write a test program that sorts the words.txt file from lab1.htm. The program should compare all three of your sorting algorithms as well as the generic sort algorithm and the list's sort algorithm by exercising all of them. You may find the benchmark class useful in your comparisons.

Lab report (due 11:00pm, the day prior to week 5 lab)

Each pair should submit one lab report. The report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure -- what approach you used to solve the problem
  • Documented source code
  • Discussion (comparison between the different sorting algorithms, your experience/impressions of the CSP, any problems you encountered, etc...)
  • CSP level 2.0 documentation (Use the online system and print the summary results. These results may be submitted in hardcopy at the beginning of week 5 lab)
  • Conclusions (what you learned, suggestions of how the lab could be improved, things you would have done differently, etc.)

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

If you have any questions, consult the instructor.

Office: CC-27C, Phone: 277-7339
Last Updated: April 14, 2000
© 2000 Dr. Christopher C. Taylor