ssoelvsten / quicksort-test Goto Github PK
View Code? Open in Web Editor NEWProgramming test for a student programmer job interview.
License: MIT License
Programming test for a student programmer job interview.
License: MIT License
The current implementation always swaps pivot_elem
with i_elem
, but that is a waste of computations, if they are the same. We can decrease the number of swaps (and with it the running time), if we only swap, when it indeed may change the array.
There are currently only 3 unit tests in test/, which do obviously not cover all interesting cases. Furthermore, we use unit tests in this project to get as close to verifying our algorithms without using an actual proof assistant.
Add as many missing test cases that you can think of; this also includes any cases currently covered, but not satisfiably so.
Currently we hardcode the choice of pivot to be high_idx
. Yet, we would like to support other strategies for picking the pivot that are better in practice. It is important to notice, that the partitioning procedure as per Lomuto requires the pivot element to reside at high_idx
before starting the partition step.
The pivot strategies we want to support are:
high_idx
. Notice, that this is an O(N2) solution for sorted (and reversely sorted) inputs.We want to support all versions simultaneously, so we need to use policies to change the behaviour of the pivot derivation.
On the feature/hoare branch is an implementation of the original quicksort as by Tony Hoare. Using the policy pattern allow the user to switch between one partitioning algorithm and another.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.