Implemenation of DS in Java.