implementation of popular sort algorithms in C