2023-02-11 19:22:37 -06:00
|
|
|
# Sorting
|
|
|
|
A program written to test the time complexity of insertion, merge, and heap sort
|
|
|
|
|
|
|
|
# Author
|
|
|
|
Gregory Crawford
|
|
|
|
|
|
|
|
# Compiling
|
|
|
|
Run `make` to compile the project.
|
|
|
|
Output files get placed into test/SORTED
|
|
|
|
|
|
|
|
# Running
|
2023-03-06 03:13:14 -06:00
|
|
|
Run the program with chosen arguments
|
|
|
|
|
|
|
|
`bin/main.out [-f filename] [-s sort-type] [-l word]`
|
2023-02-11 19:22:37 -06:00
|
|
|
|
|
|
|
# Commands
|
2023-03-06 03:13:14 -06:00
|
|
|
|
|
|
|
## bin/main.out [-a | -f filename | -d | ]
|
|
|
|
Ex: `bin/main.out -f test/PERM/perm15K.txt -s bst -l apple`
|
2023-02-11 19:22:37 -06:00
|
|
|
|
|
|
|
# Arguments
|
2023-03-06 03:13:14 -06:00
|
|
|
|
2023-02-11 19:22:37 -06:00
|
|
|
## File selection
|
2023-03-06 03:13:14 -06:00
|
|
|
> -a | --all
|
2023-03-06 21:54:40 -06:00
|
|
|
- Runs through all the original files (test/PERM/perm[15-150]K.txt)
|
2023-02-11 19:22:37 -06:00
|
|
|
- *EX: bin/main.out -a*
|
2023-03-06 03:13:14 -06:00
|
|
|
> -f path/to/file.txt | --filename path/to/file.txt
|
|
|
|
- Runs a specific file to sort
|
2023-02-11 19:22:37 -06:00
|
|
|
- *EX: bin/main.out -f perm15K.txt*
|
2023-03-06 03:13:14 -06:00
|
|
|
> -d | --default
|
2023-03-06 21:54:40 -06:00
|
|
|
- Runs sort only on the default test file (located test/PERM/perm15K.txt)
|
2023-02-11 19:22:37 -06:00
|
|
|
- *EX: bin/main.out -d*
|
2023-03-06 21:54:40 -06:00
|
|
|
> -o | --output
|
|
|
|
- Set file for outputting InOrderTreeTraversal
|
|
|
|
- *EX: bin/main.out -f test/PERM/perm15K.txt -s bst -o test/traversal.txt*
|
2023-03-06 03:13:14 -06:00
|
|
|
|
2023-02-11 19:22:37 -06:00
|
|
|
## Sorting type selection
|
|
|
|
> -s | --sort-type
|
|
|
|
- Selects a sort type
|
|
|
|
- Options:
|
2023-03-06 03:13:14 -06:00
|
|
|
- binary search tree [***default***]
|
|
|
|
- *EX: bin/main.out -s bst*
|
|
|
|
- red-black tree
|
|
|
|
- *EX: bin/main.out -s rbt*
|
2023-02-11 19:22:37 -06:00
|
|
|
- insertion
|
|
|
|
- *EX: bin/main.out -s insertion*
|
|
|
|
- merge
|
|
|
|
- *EX: bin/main.out -s merge*
|
|
|
|
- heap
|
|
|
|
- *EX: bin/main.out -s heap*
|
2023-03-06 03:13:14 -06:00
|
|
|
- all (only runs insertion, merge, and heap sort)
|
2023-02-11 19:22:37 -06:00
|
|
|
- *EX: bin/main.out -s all*
|
|
|
|
|
|
|
|
# Notes
|
2023-03-06 21:54:40 -06:00
|
|
|
- Filename for i/o and implementation are preselected through the CLI.
|
|
|
|
- BST and RBT specific methods are called once program has constructed it
|