Skip to content

Quicksort implemented in different languages

Notifications You must be signed in to change notification settings

antonini/quicksort

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quicksort

Several implementations of quicksort in multiple languages. Inspired by @hugopeixoto's mergesort project.

Rules

  1. Unless the language does not provide a standard IO library or there is no reasonable way to pass input to the program, programs should read the array to sort from stdin and output it sorted to stdout:
  2. Valid inputs are composed by two lines. The first contains a single integer, the number N of elements in the array. The second contains N integers separated by single spaces, the elements of the array to sort;
  3. The program should output a single line containing the N integers of the input array sorted and separated by single spaces, ending with a single newline;
  4. If possible, programs should not define a maximum size for the input apriori. They should be able to handle any array of reasonable size, which means they should allocate the necessary memory dynamically;
  5. Programs should be implemented using each language's data structures and idioms;
  6. There is no problem if the idiomatic way to implement quicksort in a language comes with a performance hit (for example, by not sorting in-place), but the implementation must not have an expected running time worse than O(n log n).
  7. No libraries other than the ones provided with the programming language distribution can be used.

Testing

The commands to compile and run each implementation are on the test script. To run a set of tests against an implementation, run:

./test <folder_name>

The tests to run are defined in the _test folder.

About

Quicksort implemented in different languages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 19.7%
  • Shell 17.6%
  • Assembly 17.2%
  • Java 4.4%
  • C# 4.3%
  • C++ 3.2%
  • Other 33.6%