Daily algorithm practice: More Big O

Here's an easy one for today. I think I spent more time opening the book than solving the problem. ;) 


This is super simple. The only algorithmically significant component is the for loop that iterates b times. The addition completed in the for loop isn't significant. So, the runtime complexity is O(b)

I should probably put this on Github but maybe I'll just link these posts when I'm done, IDK. 

Comments

Popular posts from this blog

Unleashing my inner Disney Princess ✩₊˚.⋆☾⋆⁺₊✧ at the 2024 Disney Princesses Half Marathon

The 20-something types of Computer Science majors

The Evenstar