Theory of Algorithms