add sorting algorithms in C code