First video in a series on how to calculate the efficiency of iterative algorithms.
Пікірлер: 4
@informativecontent47785 жыл бұрын
thanks sir i will pass my exam IA thanks to you it was really hard to find any tutorials on efficiency of algos that i understood as well as these
@matthewhennegan8395 жыл бұрын
Thanks for taking the time to comment! I'm glad you found them easy to follow. Best of luck in your exam!
@tigercaptain71217 жыл бұрын
at 2:10, the line x = x * x has a cost efficiency of 2, not 1, since you are doing two things: First, multiplying x times x, second you are assigning x to the value produced in the first step. Thanks for the video
@matthewhennegan8397 жыл бұрын
Ah it may be. Though in that case you'd say the same for x++ being short for x = x + 1 (an addition, and an assignment). I don't know enough about the efficiency differences between arithmetic operations like addition vs multiplication, or assignment vs multiplication to know for sure when you ignore one as a basic operation in favor of simply counting the most complex operations within the loop. Though either way it won't change the efficiency class it belongs to, so it may just come down to making sure you measure everything the same way when you compare them. Glad you enjoyed the video and thanks for the feedback!