study algorithms in c: reconstruct source code 1-1