OCR MEI MwA A: Tracing an Algorithm: 08 Tracing an Algorithm Complexity

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Given that B reduces by 1 every 4 steps and you have one step at the start and 2 at the end (B = 0 and Print(ABS[A])) that would mean given that B = n => Run time = 4n + 3, so for 4 that's 19, and for 16 that would be 67 so the scale factor for run time is 67/19, and when multiplied by 3 that gives 201/19 = 10.58s (3 sf). Or do we just not consider these extra steps at the start and end?

armstrongtixid