When you analyze an algorithm from the following perspective:
Big -Oh(Omricon) is actually the worst case analysis of any algorithm. If you are to define it in terms of Mathematical terms, you would write them as following:
T(n) is O(F(N)) if for all constants c and n0
Big-oh Looks at the upper bound cases
In Big-O analysis, the higher value is taken for analysis, the constants and lower values are ignored. For Example,
if there is a function 3n^2 +n+30 , the Big-O Analysis would be n^2.
Besides Big-Oh , there are other analysis such as
When writing code in programming languages, you will need to make sure that you are implementing or using the right type of data structure; otherwise, you might end up writing code that will run great when you have 100-1000 user( Example) but runs really slow when you start hitting 10,000 users. This will be very problematic in terms of usability of the software.
The following chart describes the Big-Oh Analysis of all the popular data structures and implementations in JAVA. Please note that some of the programming languages may implement them in a different way.
Some of the useful Sorting Mechanisms
Selection sort(Never use)
Insertion Sort(Best for small n)
Best for Stable Sorting
Best for overall Sorting(this is the widely used one)
Heap Sort(Usually good but has poor cache Performance)