Daily Algorithm Practice

Still working through Big O. 


This one is super simple. 

If you notice, there are no loops, no recursion, etc. Just a conditional. Regardless of what the values for a and b are, the function is going to take what is mathematically the same amount of time. Thus, this function is doing a constant amount of work, so the runtime is simply O(1)

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