Commit a7830143 authored by Hrishee Shastri's avatar Hrishee Shastri
Browse files


parent b005c4be
......@@ -4,10 +4,24 @@ Sorting by Reversals is a small python program that records the time to sort ran
## Installation
Simply download the repository.
Simply download the repository. No dependencies required, assuming Python3 is installed.
## Usage
To run the program, call ```main(NUM_PERMS_PER_LENGTH, LENGTH_FROM, LENGTH_TO)``` in the `````` file, where
### Unit tests
To run the unit tests, enter ```python -m unittest``` into the command line at the top level directory.
### Reversal routing
Entering ```echo P | python``` into the command line will print out the reversals in order to sort the permutation P using
For example, `echo 0 1 3 2 | python` will output to the console `[(2,3)]` because a reversal starting at index 2 and ending at index 3 will
sort the permutation.
Alternatively, you can type `python` and from there simply input permutations in the command line and recieve the sorting sequence of reversals as output.
### Data collection
To run the program for data collection, call ```main(NUM_PERMS_PER_LENGTH, LENGTH_FROM, LENGTH_TO)``` in the `````` file, where
```NUM_PERMS_PER_LENGTH:``` number of random permutations to run the algorithms on per permutation length
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment