java+algo practice programs