Some Algorithms written in JAVA