Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eggpi/sorting-networks-test
Three implementations of quicksort, one of them using sorting networks for testing.
https://github.com/eggpi/sorting-networks-test
Last synced: 1 day ago
JSON representation
Three implementations of quicksort, one of them using sorting networks for testing.
- Host: GitHub
- URL: https://github.com/eggpi/sorting-networks-test
- Owner: eggpi
- Created: 2011-09-02T14:52:43.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-21T01:00:29.000Z (almost 12 years ago)
- Last Synced: 2024-12-25T08:06:43.620Z (3 days ago)
- Language: C
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This repository contains three implementations of the Quick Sort algorithm,
meant to be compared for their running speeds on various input sizes and types.The first implementation, in textbook.c, is the simplest and most commonly found
on textbooks.The second, in insertion.c, uses insertion sort for small arrays.
The third, in network.c, uses sorting networks for small arrays.
All three implementations are designed to sort integers and use the same
simple partitioning algorithm, which can be found in partition.c.In order to run the tests, just compile:
$ make
And then run the desired test specifying type and size of input:
$ ./network a 1024
The available types of input are:
(a)scending - an already sorted array of integers;
(d)escending - an array of integers sorted in reverse;
(e)quals - an array of zeroes;
(r)andom - an array of random integers.The results/ directory contains the raw data for my test results.
Its two subdirectories correspond to the compiler optimization flags used for
the code on each run, -O1 and -O2.Inside each of these you will find several files, each of the form
..
containing the times for the five runs I averaged in my tests.
For more information, please see:
http://guilherme-pg.com/2011/09/02/Fun-with-sorting-networks.html
http://guilherme-pg.com/2012/03/27/Sorting-networks-revisited.html