What big O notation does and doesn't tell you

In my last blog post, I wrote about time complexity.

In summary, time complexity is a way to determine the efficiency or inefficiency of an algorithm by determining the maximum number of steps that it will take to execute an operation on a given input.

However, the Big O notation used to describe time complexity, will not always tell you the fastest algorithm. In fact, in certain use cases, it may actually imply a slower solution.

Let's start with one of the fundamental rules of big O notation:

Time Complexity

The time complexity of an algorithm quantifies the amount of time taken for the algorithm to run, as a function of the input. But because there are many variables in determining the amount of time an operation might take, a more consistent way of thinking about time complexity, is the maximum amount of steps taken to perform an operation.

SilverStripe: MVC framework and CMS

If you're looking to build a website with backend functionality, there are numerous systems to choose from. Most fit into the category of being either a framework, or a CMS (content management system).

Examples of CMSs include Wordpress, Drupal and Joomla. Examples of frameworks include Rails, Djano, and Laravel. The difference between these systems is not always clearly defined. Drupal, for example, is often considered to be both a CMS and a Framework.

Automate your testing with the Ruby you already know

If you're beginning to write code, perhaps for a personal project, school project, or a bootcamp, you'll need to ensure that your code is reliable and works as expected.

But how do you go about testing your code?

Do you open up a console such Ruby’s IRB and manually type your code, do you paste it, or perhaps import your files? Or perhaps you insert breakpoints with a tool such as Pry, and then manually test it. Or perhaps you run the file with Ruby, instantiate instances, and test some methods.

Subscribe to