Cs340 - Project 1 and 2
Go to file
2023-03-06 23:20:34 -06:00
bin Fixed .gitignore 2023-02-11 19:23:48 -06:00
build Fixed .gitignore 2023-02-11 19:23:48 -06:00
include Finished main part of RBT and BST 2023-03-06 22:24:59 -06:00
src Finished main part of RBT and BST 2023-03-06 22:24:59 -06:00
test Separated sorts into separate namespace 2023-02-26 21:34:32 -06:00
.gitignore Minor .gitignore change 2023-03-06 23:20:34 -06:00
Makefile Added user interaction with BST and RBT 2023-03-06 21:54:40 -06:00
README.md Added user interaction with BST and RBT 2023-03-06 21:54:40 -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

Run the program with chosen arguments

bin/main.out [-f filename] [-s sort-type] [-l word]

Commands

bin/main.out [-a | -f filename | -d | ]

Ex: bin/main.out -f test/PERM/perm15K.txt -s bst -l apple

Arguments

File selection

-a | --all

  • Runs through all the original files (test/PERM/perm[15-150]K.txt)
  • EX: bin/main.out -a

-f path/to/file.txt | --filename path/to/file.txt

  • Runs a specific file to sort
  • EX: bin/main.out -f perm15K.txt

-d | --default

  • Runs sort only on the default test file (located test/PERM/perm15K.txt)
  • EX: bin/main.out -d

-o | --output

  • Set file for outputting InOrderTreeTraversal
  • EX: bin/main.out -f test/PERM/perm15K.txt -s bst -o test/traversal.txt

Sorting type selection

-s | --sort-type

  • Selects a sort type
  • Options:
    • binary search tree [default]
      • EX: bin/main.out -s bst
    • red-black tree
      • EX: bin/main.out -s rbt
    • insertion
      • EX: bin/main.out -s insertion
    • merge
      • EX: bin/main.out -s merge
    • heap
      • EX: bin/main.out -s heap
    • all (only runs insertion, merge, and heap sort)
      • EX: bin/main.out -s all

Notes

  • Filename for i/o and implementation are preselected through the CLI.
  • BST and RBT specific methods are called once program has constructed it