sedgewick algorithms in c code