Big-O Notation, why and what
What is a good code?
- Readable
- Scalable
- Speed - Time Complexity
- Memory - Space Complexity
faster = more space, less space = slower
Why do we need Big-O notation?
To scale the quality of code by seeing the increase in number of operations or spaces when the elements (or input) increases.
or in other words..
To analyze how many steps a program will take (the performance behavior of an algorithm) with regards to an increasing amount of input.
We use big-o to measure why some data structures are better than others in specific situations.
Right Data Structures + Right Algorithms = Good Programs
It is not about how much time it takes, but more about how many steps it takes to perform.