Relative Content

Tag Archive for big-o

Big Oh notation does not mention constant value

I am a programmer and have just started reading Algorithms. I am not completely convinced with the notations namely Bog Oh, Big Omega and Big Theta. The reason is by definition of Big Oh, it states that there should be a function g(x) such that it is always greater than or equal to f(x). Or f(x) <= c.n for all values of n >n0.

Help with algorithmic complexity in custom merge sort implementation

I’ve got an implementation of the merge sort in C++ using a custom doubly linked list. I’m coming up with a big O complexity of n^2, based on the merge_sort() > slice operation. But, from what I’ve read, this algorithm should be n*log(n), where the log has a base of two.

Problems Calculating Big-O Complexity

I’m a complete beginner to Java, only in my second quarter of classes. I’m having trouble understanding our current chapter about calculating big-O for methods. So I thought I was right in saying that the big-O for these two methods is simply O(N), since there is only one loop that loops through the entire list, but apparently they’re either O(NlogN) or O(logN). I really can’t see why. Can anyone help me understand?

Constants and Big O [duplicate]

This question already has answers here: Big Oh notation does not mention constant value (7 answers) Closed 11 years ago. Are constants always irrelevant even if they are large? For example is O(10^9 * N) == O(N) ? big-o 0 Big O describes how an algorithm scales; not, strictly speaking, how long it takes to […]

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.