Common algorithms via Java