Some algorithms written in java..