jeffgerickson / algorithms

Bug-tracking for Jeff's algorithms book, notes, etc.
7.95k stars 1.02k forks source link

[Chapter-3][Exercise-30][Other Feedback] For loop time complexity #254

Open RishiVinayaka opened 3 years ago

RishiVinayaka commented 3 years ago

Should taking through 1 to N be considered O(N) complexity or O(N logN) complexity, as we also need to keep in mind the time taken to add 1 to a number K which is O(logK), or should we only consider the length of integer during comparison operations only? Because we are also required to take into consideration about length of digits in this question Can further elaboration be made regarding this in book