some algorithm code for Introduction to algorithm