sedgewick alg