Skip to content

Files

Latest commit

 

History

History

QuickSort

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

QuickSort Algorithm

Build Status

About

Check if there are distinct numbers x,y in the input file that satisfy x + y = sum.
For better performance sort the vector in O(n * log n) and then for every element x binary search for t - x. Could be done even better instead of binary search for t - x store key t - x in a hash table.

Running code examples

C implementation:

cd C/
gcc -o QuickSort QuickSort.c (Linux) or run the 'make' command
./QuickSort ../in/inputBig.txt (Linux)

compile with Visual Studio | MinGW | DevC++ (Windows)
QuickSort.exe ../in/inputBig.txt (Windows)

Java implementation:

cd Java/
mvn clean install
java -jar target/quicksort-1.0.0.jar ../in/inputBig.txt

For the input files in in/ folder the expected results are: the vectors sorted.

License

QuickSort is released under the MIT License.
You can find a copy of this license in LICENSE.txt.