U
uppe
Hey everyone,
I've just finished my implementation of the merge-sort algorithm in C,
and I thought I could ask for some feedback. (One can always improve,
they say)
Right now, the code sorts integers in an ascending order, which
probably isn't very useful on its own.
I know the code works for a reasonable and arbitrary size of input, but
how about using a bignum library (such as gmp) for adding the feature
of sorting inputs of any size? As well as sorting elements of any size.
Since I'm not very experienced with C yet, I could not really see if
there were any chances for memory leaks. Is it true that whenever I use
malloc() without an accompanying free(), a memory leak could occur?
Anyway, the source code is available here:
http://www.student.lu.se/~mah06jfo/code/mergesort-0.1.tar.gz
Thankful for any advice
- uppe
I've just finished my implementation of the merge-sort algorithm in C,
and I thought I could ask for some feedback. (One can always improve,
they say)
Right now, the code sorts integers in an ascending order, which
probably isn't very useful on its own.
I know the code works for a reasonable and arbitrary size of input, but
how about using a bignum library (such as gmp) for adding the feature
of sorting inputs of any size? As well as sorting elements of any size.
Since I'm not very experienced with C yet, I could not really see if
there were any chances for memory leaks. Is it true that whenever I use
malloc() without an accompanying free(), a memory leak could occur?
Anyway, the source code is available here:
http://www.student.lu.se/~mah06jfo/code/mergesort-0.1.tar.gz
Thankful for any advice
- uppe