Skip to content

Commit

Permalink
1. BUG FIX: in compareArray() function
Browse files Browse the repository at this point in the history
2. ADDED: explanation of the working
  • Loading branch information
fenilgmehta committed Jan 20, 2019
1 parent 259cbcf commit b11ae9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ Graph
![Speed Comparison, int8_t](https://raw.githubusercontent.com/fenilgmehta/Fastest-Integer-Sort/master/graphs_and_analysis/all_comparisons/rawData_int8_t/Figure_1_int8_t.png)


Basic working
----------------------------------
It is a stable sorting algorithm.
This algorithm takes the advantage of bitwise operations provided by the C++ language on top of processors which run at a very high speed as compared to the other operations like addition, subtraction, multiplication, division, etc. Along with this, it uses radix sort to make the sorting faster.
I have combined the above mentioned things into one algorithm which would sort the input given to it. To improve the performance for small size of input arrays, I have used insertion sort and merge sort.
The graphs above shows how ir_sort::integer_sort starts performing better with higher array size.


Usage
----------------------------------
For projects:
Expand Down
2 changes: 1 addition & 1 deletion test/project_SortingBest_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ bool compareArray(RandomAccessIterator first, RandomAccessIterator last, RandomA
int index = 0;

while(it_first != last){
if(it_first!=it_second){
if((*it_first)!=(*it_second)){
cout << "\n\nERROR: arrays not equal";
db3(index, *it_first, *it_second)
dbiter("arr1[]", first, distance(first, last));
Expand Down
2 changes: 1 addition & 1 deletion test/raw_data_generator_integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ bool compareArray(RandomAccessIterator first, RandomAccessIterator last, RandomA
int index = 0;

while(it_first != last){
if(it_first!=it_second){
if((*it_first)!=(*it_second)){
cout << "\n\nERROR: arrays not equal";
db3(index, *it_first, *it_second)
dbiter("arr1[]", first, distance(first, last))
Expand Down

0 comments on commit b11ae9d

Please sign in to comment.