From a0f7e43cd79e38f2250ad0413b7e11675537117b Mon Sep 17 00:00:00 2001 From: Ovidio de Jesus Henriquez Date: Mon, 26 Dec 2016 11:47:17 -0600 Subject: [PATCH] Updated README and fixed the file name in MergeSort.h/ --- MergeSort.h | 2 +- README.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/MergeSort.h b/MergeSort.h index ecd96a7..1f20f56 100644 --- a/MergeSort.h +++ b/MergeSort.h @@ -1,5 +1,5 @@ /* -** File Name: MergeSort.H +** File Name: MergeSort.h ** Author: Ovidio de Jesus Henriquez ** ** This file contains my implementation of the merge sort algorithm to use for diff --git a/README.md b/README.md index 4e18e50..48c1960 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # MergeSort This repository will contain my C++ implementation of the merge sort algorithm for educational purposes. + +# Compile Instructions +In the terminal, run the following: +``` +make all +``` + +# Execution Instructions +To run the test file, run the ```test.bin``` file produced by the compiler. + +# Algorithm Details +The algorithm is implemented as follows. The MergeSort.h file contains a single function named ```merge_sort``` +that accepts any one dimensional vector of any type (as long as the type has a less than or equal to operator). +The algorithm first divides the given vector in half and recursively calls the ```merge_sort``` function. +Once the subvectors are equal to 1 element in size, the single element is returned. The next step in the algorithm +is to sort the two halves of the subvectors by iterating through each of them and inserting the elements +into a new sorted vector in order from least to greatest. Once the sorting is finished, the sorted vector is +returned. \ No newline at end of file