to satisfy ourselves that this does indeed workwe can run the following test functionimport random def test()for in range( ) random randint( , ** random randint( , ** expected result karatsuba(xyif result !expectedreturn("failed"return('ok'runtime analysis it should be becoming clear that an important aspect to algorithm design is gauging the efficiency both in terms of space (memoryand time (number of operationsthis second measurecalled runtime performanceis the subject of this section it should be mentioned that an identical metric is used to measure an algorithm' memory performance there are number of ways we couldconceivablymeasure run time and probably the most obvious is simply to measure the time the algorithm takes to complete the major problem with this approach is that the time it takes for an algorithm to run is very much dependent on the hardware it is run on platform-independent way to gauge an algorithm' runtime is to count the number of operations involved howeverthis is also problematic in that there is no definitive way to quantify an operation this is dependent on the programming languagethe coding styleand how we decide to count operations we can use this ideathoughof counting operationsif we combine it with the expectation that as the size of the input increases the runtime will increase in specific way that isthere is mathematical relationship between nthe size of the inputand the time it takes for the algorithm to run much of the discussion that follows will be framed by the following three guiding principles the rational and importance of these principles should become clearer as we proceed these principles are as followsworst case analysis make no assumptions on the input data ignore or suppress constant factors and lower order terms at large inputs higher order terms dominate focus on problems with large input sizes