Algorithms implements by Java