added class to determine time complexity of the algorithm