Practicing algorithms in C