• Home
  • Blog
  • SNHU Algorithms and Data Structures Question

SNHU Algorithms and Data Structures Question

0 comments

Prompt

You will need to perform the following steps to complete this activity:

Setup: Begin by creating a new C++ project with a project type of “Hello World C++ Project”.

  1. Name the project “VectorSorting”. Remember to pick the correct compiler in Toolchains and click Finish. This will create a simple VectorSorting.cpp source file under the /src directory.
  2. Download the starter program files and copy them to the project’s /src directory, replacing the existing auto-generated ones. Remember to right-click on the project in the Project Explorer pane on the left and Refresh the project so it adds all the new files to the src folder underneath.
  3. Because this activity uses C++ 11 features, you may need to add the -std=c++11 compiler switch to the miscellaneous settings.

Task 1: Implement the selection sort algorithm:

  1. Code the selection sort logic using “bid.title” as the sort field.
  2. Invoke the selectionSort() method from the main() method including collecting and reporting timing results.

Task 2: Implement the quicksort algorithm:

  1. Code the quicksort logic using “bid.title” as the sort field.
  2. Invoke the quickSort() method from the main() method including collecting and reporting timing results.

Here is sample output from running the completed program:

> ./VectorSorting ~/Downloads/eBid_Monthly_Sales.csv
> VectorSorting.exe DownloadseBid_Monthly_Sales.csv

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}