I was just told by someone that my code should follow the complexity guideline of O(logn) + O(n). When prompted for clarification, I was presented with, "the complexity of the code :)" In any event, any clarification over and above the provided would be appreciated.
O(logn) + O(n) = O(n)
"I was just told by someone that my code should follow the complexity guideline of O(logn) + O(n)" - without knowing what your code is supposed to do, no one can answer what its reasonable complexity should be.
See Big O notation
Without context, this is rather difficult to answer. "O(logn) + O(n)" by itself makes little sense because the asymptotic complexity of any given algorithm would be dominated by the linear term, so writing "+ O(logn)" doesn't clarify anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With