Question: Need help with C++ assignment. The directions are write an 'all hares' version of the bubble sort. Instead of always looping through the list
Need help with C++ assignment. The directions are " write an 'all hares' version of the bubble sort. Instead of always looping through the list from lowest to highest you will alternate. The first pass will go from lowest to highest and the next pass will go from highest to lowest. You will use a class called SortTester that will create a list and has built in compare and swap functions. You need to call the compare and swap functions provided for the code to work correctly. You are being tested on your algorithm. You are going to fill in the details for the function singleBubblePass(). The result of that function is to execute either a highest to lowest or lowest to highest single pass of a bubble sort (depending on if pass is odd or even). The test bench will test the correctness of the first 5 passes (8 pts for the first pass, 5pts for the second, 2 each for the next two), correctness of a fully sorted list at the end (8 pts), and there will be a bonus if you get all of those correct and are able to correctly identify a modification to do fewer comparison's than my basic version (5 pts)"
this is what I have so far:
main.cpp:
#include SortTester.h: #include SortTester.cpp: #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
