My Algorithm Assigement Work in Java.