Datastructures and Algorithms