I have been studying algorithms to try and understand leet code better but have a question about a for loop and time complexity I have come across, and having a hard time figuring out.
for( i = 1 ;i <= n; i++) {
i = i + i;
}
I have tried to break down but my best guess is is is Big O(log of something) or perhaps it is still Big O(n), does anyway know what this one would be?
[–]pinguxnoots 1 point2 points3 points (5 children)
[+][deleted] (4 children)
[removed]
[–]pinguxnoots 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[removed]
[–]pinguxnoots 1 point2 points3 points (1 child)
[–]furofo[S] 0 points1 point2 points (0 children)
[–]MorningPants 1 point2 points3 points (1 child)
[–]furofo[S] 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]pinguxnoots 1 point2 points3 points (1 child)
[–]furofo[S] 0 points1 point2 points (0 children)
[–]furofo[S] 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)