Posts

Showing posts from September, 2017

Big O Notation, explained step by step

Image
What the heck is the Big O? do we really need it? is it really helpful? Well since I started working in Unosquare, I've heard a lot of Big O and its importance so I decided to see what's the big deal about it. //It's Important Well you know that there're 2 things that can tell us how efficient a program is: Performance: This depends on the machine it is executed: memory, disk space, etc. Complexity: How many resources your program needs to run: requirements, algorithm scale, etc. Complexity of course affects the performance, but performance cannot affect the complexity, so let's create the less complex code we can, but how can we determine the complexity of our code? easy, using the Big O notation. But there are multiple types of Big O, depending on what sentence or statement you are evaluating, it could be a simple if/else block or a function , depending on that we can say it is either linear or quadratic or maybe one of the following: No