Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Many students are slightly mystified about what exactly the running time T ( n ) as a function of n means, and that s not
Many students are slightly mystified about what exactly the running time Tn as a function of n means, andthats not exactly surprising. After all, the running time of a programalgorithm depends on its entire input, notjust the size of the input. For some inputs of size n the algorithm might be fast, and for others, it might be slow.So really, the running time can be written as a function TinputI where I is the input of the algorithm. But weusually want to get an idea of how the running time grows as a function of the inputs size. So we define and mostly focus on Tn maxinputs I of size n TinputIThis is the definition of running time as a functionof n Now, lets explore what this means for running time upper and lower bounds. For both of the followingsubquestions, in your answers, you should not be referencing any maximum or similar things. Instead, youwill want to use for all and exists clearly, ie your text or formulas if you prefer should be describingquantifiers and talking about the running time on inputs.a Suppose that you want to show that Tn Ofn What do you need to show?b Suppose that you want to show that TnOmega gn What do you need to show?Both of these parts are not very hard if you are precise in applying the definitions and thinking through them.But its easy to get the second one wrong if you just try to wing it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started