CSCI 261 - Programming Concepts - Spring 2022

Lab 5B - Sorting I: Sorting a List

This lab is due by Wednesday, April 13, 2022 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.


Instructions


You have two degrees of freedom for this lab.

  1. You need to create a list, which can be implemented as either:
    1. an array
    2. a linked-list
  2. You need to sort the list using one of the sorting algorithms just discussed:
    1. Selection Sort
    2. Insertion Sort
    3. Bubble Sort

The implementation is to your choosing (classes, functions).

To test your implementations, perform the following steps:

  1. Create a list of integers
  2. Populate the list with the values in order: 4 3 8 1 5 9 7 2 6
  3. Print the list forwards (prints 4 3 8 1 5 9 7 2 6)
  4. Sort the list
  5. Print the list forwards (prints 1 2 3 4 5 6 7 8 9)

Lab Submission


Submit your main.cpp, Makefile, *.hpp, *.h, *.cpp file(s).

You will submit your solution to this lab with the rest of Set5. Detailed instructions for doing this are posted in Assignment 5.


This lab is due by Wednesday, April 13, 2022 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.