Please explain the statement that the function an+b belongs to O(n^2) and Θ(n)?
Let’s say I have a linear function f(n)= an+b
, what is the best way to prove that this function belongs to O(n2) and Θ(n)
?
Programmaticaly finding the Landau notation (Big O or Theta notation) of an algorithm?
I’m used to search for the Landau (Big O, Theta…) notation of my algorithms by hand to make sure they are as optimized as they can be, but when the functions are getting really big and complex, it’s taking way too much time to do it by hand. it’s also prone to human errors.
Notation for the average time complexity of an algorithm
What notation do you use for the average time complexity of an algorithm? It occurs to me that the proper way would be to use big-theta to refer to a set of results (even when a specific try may differ). For example, average array search would be Θ(n+1)/2.