implementation of General Purpose Algorithms on DS in Java