O'Reilly logo

A Common-Sense Guide to Data Structures and Algorithms by Jay Wengrow

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5Optimizing Code with and Without Big O

We’ve seen that Big O is a great tool for contrasting algorithms and determining which algorithm should be used for a given situation. However, it’s certainly not the only tool. In fact, there are times where two competing algorithms may be described in exactly the same way using Big O Notation, yet one algorithm is significantly faster than the other.

In this chapter, we’re going to learn how to discern between two algorithms that seem to have the same efficiency, and select the faster of the two.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required