DEV Community

Cover image for AN OUTSTANDING EXPOSITION OF THE "Big O" NOTATION

AN OUTSTANDING EXPOSITION OF THE "Big O" NOTATION

Onyeanuna prince on July 24, 2022

Understanding how the Big O Notation is used to measure algorithm performance. Big O is a fundamental concept in the field of computer s...
Collapse
 
incrementis profile image
Akin C.

Hello Onyeanuna Prince,

Thank you for your article.
It's easy to read and understand.
I particularly like the diagram regarding Big O notations.
Also, I would have liked to see a simple example of the O(Log N) example, but I understand that the O(Log N) is a bit difficult to explain.

Collapse
 
aahil13 profile image
Onyeanuna prince

Thank you for reading, and your very honest and beautiful comments, it means alot.

Examples on O(Log N) are quite long and alittle bit complex, adding them here would have overstepped the goal of this article, which is making this subject as simple as possible.

You can also go through some resources on binary search algorithm.

Collapse
 
aminmansuri profile image
hidden_dude

The binary search algorithm is simple.

Basically:

  1. choose the middle item, if that's the one, you're done!
  2. if it's less than the middle item, throw away the top half and go to 1.
  3. if it's more than the middle item, throw away the bottom half and go to 1.

Do this until you run out of an array.

The concept of Log N (base 2, also written Lg N sometimes) is to discard half your problem with each iteration.

For such cases you're problem will grow only logarithmically.

Thread Thread
 
aahil13 profile image
Onyeanuna prince

This is perfectly explained!!!
This is amazing 🤩

Collapse
 
andrewbaisden profile image
Andrew Baisden

That's a good breakdown of the subject thanks for sharing.

Collapse
 
aahil13 profile image
Onyeanuna prince

Thank you Andrew!!

Collapse
 
edthix profile image
Edham Arief Dawillah / edthix

Good intro level. Clear.

Collapse
 
aahil13 profile image
Onyeanuna prince

Thank you very much!!!

Collapse
 
eucarlos profile image
Carlos Alves

Great article, clean text and easy to understand.
Thanks for this.

Collapse
 
aahil13 profile image
Onyeanuna prince

You're very welcome. Thank you for reading 😊❤️

Collapse
 
buddhadebchhetri profile image
Buddhadeb Chhetri

Thanks man this is really helpful :)

Collapse
 
aahil13 profile image
Onyeanuna prince

Thank you for reading and I'm happy it helped you.

Collapse
 
rollergui profile image
Guilherme

Thank you for this! I've recently failed a test regarding some of these concepts, this helps me so much!

Collapse
 
aahil13 profile image
Onyeanuna prince

You're welcome ☺️

Collapse
 
projektorius96 profile image
Lukas Gaucas

Cornerstone sentence :

Big O is a way to determine the most efficient algorithm for solving that problem.

Collapse
 
aahil13 profile image
Onyeanuna prince

Yes!, You are very correct Micheal.
Thank you for this observation ❤️