some basic Algorithms implement by java