Algorithms on datastructures