Skip to content

NickWattsCS/Sorting_Master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nicholas Watts
Latest Version release: July 18, 2020

This document explains how to use the C++ program "sort", the testing shell script, and the python script "graphs".

COMPONENTS
---------

1) README: This file that tells you how to execute the program.

2) makefile: A configuration file that lets you use the src files to make executables and run scripts

3) /src directory: A directory that contains all header and class files.

4) /tmp directory: A directory that contains all object files.

5) /bin directory: A directory that contains all executables.

ACTIONS OF THE MAKEFILE
-----------------------

1) make sort: compiles the sort program

2) make test: tests the functionality of each sort to make sure it effectively sorts a sample array of 100 elements 1000 times.

3) make graphs: shows the time complexity of each sort as input increases

4) make clean: cleans the tmp file and erases the sort executable.

EXECUTING THE SORT PROGRAM
--------------------------

./sort [--help] [[-i] [-m] [-h] [-q] [-c] [-r] [-b] 
	[-v | --verbose] [-n N | --size N | --list file]]

Support functionality:
	--help: shows this usage text
	-v | --verbose: print array flag

Sort control functionality:
	-i: insertion sort flag
	-m: merge sort flag	
	-h: heap sort flag
	-q: quicksort flag
	-c: counting sort flag
	-r: radix sort flag
	-b: bucket sort flag
	-n N| --size N | --list file: array input flag, where 
		N is a number greater than 0, and file is a text file 
		of space-separated numbers sort
----
To start the sort program in the command line, type "./sort," the sort flag you wish to use--as explained
	above in the components section--and the method of vector population that you prefer. One of the 
	following arguments must be provided, or the executable will not run:

	1) To generate a randomized vector, type "--size" or "-n" followed by an unsigned number. This will
		create an unsorted vector of size n, which is then sorted but the sort specified in the command
		line arguments. If a sort is not specified, or if more than one sort is provided, then the
		executible will not run. If the "--list" flag is placed along with the "--size" or "-n" flags, then
		the executable will not run.

	2) To generate a specific set of numbers, place a list of white-space-separated numbers into a text file
		and type "--list" followed by the filename. One has been provided, called "list.txt"

The flags "-v" and "--verbose" are optional, and allow the user to print out the sorted vector. When used at higher
	amounts, the execution time is exacerbated terribly.

To remove all object files and the executable, type "make clean" in the command line.

EXECUTING THE GRAPHING SCRIPT
-----------------------------
For the graphs script to work correctly, the sort executible must be made first. This can be created by
	typing "make sort" into the command line. Otherwise, the python interpreter will complain that the
	sort executible does not exist.

If the sort executible has been compiled, then typing "make graphs" in the command line will execute
	the code in graphs.py. This runs each sort at each of the specified input sizes--10, 50, 100,
	500, 1000, 5000, 10000, 50000, 100000, 500000, and 1000000--and records the time it takes to
	complete each, before sending all inputs and their running times into a graphing object provided
	by matplotlib.

KNOWN BUGS
----------
Running 'make sort' without the necessary dependencies causes the recipe to fail. Each object-file dependency 
	must be created with the make file first if all the object files are not already in the tmp folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors