sample codes of Algorithms