Steps For Naive – Intro to Algorithms

Steps For Naive – Intro to Algorithms


This example is actually maybe a little bit easier and probably a little bit more useful and interesting. What we’d like to do is count the number of steps that it takes to run naive as a function of a. Just as before, I’d like you to write your answer as a function time that we can run, give different inputs to, and evaluate it that way. Function time should take as input a, and it should return the number of steps. it takes to execute naive(a, b) as a function of a.

Leave a Reply

Your email address will not be published. Required fields are marked *