Skip to content

College work done while studying Data Structures, specifically basic Sorting and Searching

Notifications You must be signed in to change notification settings

cmilliga/SortnSearchCollegeWork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SortnSearchCollegeWork

Example 1 of an assignment done while studying Data Structures, specifically basic Sorting and Searching:

THIS IS THE FULL DESCRIPTION OF THE PROMPT FOR THIS PROJECT:

Write a complete program, to collect statistics on a series of sorts

The main program will continue the following until the end of the set of data.

  1. Call a method to read in a group of numbers to be sorted.
  2. Call 3 methods (or put into 1 if you wish) to sort these values using 3 different sorts.
  3. Call a method to compare the 3 sorts.

Step 1: The read method will first read a heading describing the group of numbers (ie: - the heading maybe 10 numbers in order, 50 numbers in random order or 100 numbers in reverse order). Then it will read in a group of numbers. The original group should be printed out as it is read in.

Step 2: The three sorts should all receive the data in their original order before sorting.

  1. One sort will be an inefficient one like the Bubble sort
  2. The second sort should be an efficient sort like the Quicksort
  3. The 3rd sort can be any one of your choice

After each individual sort finishes the sorted array should be printed. You should add code and then print for each sort the number of comparisons and/or interchanges that each of the 3 sorts required. You can use global variables to track these counts.

You can then compare the 3 types of sorts to see for each set which did the best most efficient job.

Remember that each group of data must start with a heading describing what it is testing. You are allowed to have repeats in the group but there should not be too many repeated values.

About

College work done while studying Data Structures, specifically basic Sorting and Searching

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages