Added java algorithms