What is Big O Analysis in computer science – a tutorial
First and foremost, do not even walk into a software interview without knowing what Big O Analysis is all about – you will embarrass
yourself. Big O Notation is simply something that you must know if you expect to get a job in this industry. Here we present a
tutorial on Big O Notation, along with some simple examples to really help you understand it. You can consider this article to be
sort of a big O notation for dummies tutorial, because we really try to make it easy to understand.
When solving a computer science problem there will usually be more than just one solution. These solutions will often be in the form
of different algorithms, and you will generally want to compare the algorithms to see which one is more efficient.
This is where Big O analysis helps – it gives us some basis for measuring the efficiency of an algorithm. A more detailed explanation
and definition of Big O analysis would be this: it measures the efficiency of an algorithm based on the time it takes for the
algorithm to run as a function of the input size. Think of the input simply as what goes into a function – whether it be an array of
numbers, a linked list, etc.
Big O Notation Practice Problems
Even if you already know what Big O Notation is, you can still check out the example algorithms below and try to figure out the Big O
Notation of each algorithm on your own without reading our answers first. This will give you some good practice finding the Big O
Notation on your own using the problems below.