logoalt Hacker News

moi2388last Sunday at 1:49 PM1 replyview on HN

My algorithm is O(n+n+..n) which is O(n), since there we also ignore addition fortunately :D


Replies

AlotOfReadinglast Sunday at 3:04 PM

It would only be O(n) if the number of additions was constant. Here it varies with the size of the multiplier, giving us O(n*m).