Skip to content

Sorting in C is a simple utility program for sorting numbers written entirely in C

License

Notifications You must be signed in to change notification settings

Dimagreg/Sorting-in-C

Repository files navigation

Sorting in C

Sorting in C is a simple utility program for sorting numbers written entirely in C. Default sorting algortihm is Quick Sort but following sorting algortihms can be used:

  1. Insertion Sort
  2. Bubble Sort
  3. Selection Sort
  4. Merge Sort
  5. Heap Sort
  6. Counting Sort
  7. Radix Sort
  8. Bucket Sort
  9. Bingo Sort
  10. Shell Sort
  11. Tim Sort
  12. Comb Sort
  13. Pigeonhole Sort
  14. Cycle Sort
  15. Cocktail Sort
  16. Bitonic Sort
  17. Pancake Sort
  18. Bingo Sort
  19. Gnome Sort

Installation

To build the project use:

./build.sh

Usage

Generate a file with 10000 numbers and shuffle them

mySort -g original.txt  original_shuf.txt 10000

The maximum amount of numbers that can be genereted is restricted to 80% of available memory

Shuffling uses an algorithm to make sure <1% of numbers are consective

Sort the shuffled file using Insertion Sort

mySort -s insertion original_shuf.txt  original_sorted.txt

For more commands consult man page

Man

The utility comes with a man page that can be accessed with:

mySort --help

man

STATS

By default, STATS option is turned on which will approximate the time required to sort the file using a certain sorting algorithm

To modify STATS/DEBUG values consult /main.c

image

NOTE! It becomes innacurate as you increase the amount of numbers to be sorted

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

GNU

About

Sorting in C is a simple utility program for sorting numbers written entirely in C

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages