Claim 35 Post Templates from the 7 best LinkedIn Influencers

Get Free Post Templates
David Regalado

David Regalado

These are the best posts from David Regalado.

2 viral posts with 2,798 likes, 233 comments, and 142 shares.
2 image posts, 0 carousel posts, 0 video posts, 0 text posts.

๐Ÿ‘‰ Go deeper on David Regalado's LinkedIn with the ContentIn Chrome extension ๐Ÿ‘ˆ

Best Posts by David Regalado on LinkedIn

And here we go again...

Don't be so selfish. Put some comments on your code.

--
โ˜๐Ÿ‘จโ€๐Ÿ’ป

๐Ÿ‘‰ I post daily about all things data-related. Follow me for more.


#software #dataengineering #datascience #python #scala
Post image by David Regalado
Big O notation is a mathematical notation that describes theย limiting behaviorย of aย functionย when theย argumentย tends towards a particular value or infinity. The letter O stands forย ๐˜–๐˜ณ๐˜ฅ๐˜ฏ๐˜ถ๐˜ฏ๐˜จ, meaning theย order of approximation.

Big O notation doesn't show theย timeย an algorithm will run. Instead, it shows the number of operations it will perform. Big O notationย is used to classify algorithms according to how their running time or space requirements grow as the input size grows.

๐๐ข๐  ๐Ž ๐ž๐ฌ๐ญ๐š๐›๐ฅ๐ข๐ฌ๐ก๐ž๐ฌ ๐š ๐ฐ๐จ๐ซ๐ฌ๐ญ-๐œ๐š๐ฌ๐ž ๐ซ๐ฎ๐ง ๐ญ๐ข๐ฆ๐ž

Imagine that you're a teacher with a student named Jane. You want to find her records, so you use a simple search algorithm to go through your school district's database.

You know that simple search takes O(n) times to run. This means that, in the worst case, you'll have to search through every single record (represented by n) to find Jane's.

But when you run the simple search, you find that Jane's records are the very first entry in the database. You don't have to look at every entry โ€“ you found it on your first try.

Did this algorithm take O(n) time? Or did it take O(1) time because you found Jane's records on the first try?

In this case, O(1) is the best-case scenario โ€“ you were lucky that Jane's records were at the top. But Big O notation focuses on the worst-case scenario, which is O(n) for simple search. Itโ€™s a reassurance that simple search will never be slower than O(n) time.

๐Ÿ‘‰ Here are some common algorithms and their complexity in Big O notation:

๐Ž(๐ฅ๐จ๐  ๐ง):ย Binary search
๐Ž(๐ง):ย Simple search
๐Ž(๐ง * ๐ฅ๐จ๐  ๐ง) Merge sort
๐Ž(๐งยฒ):ย Selection sort
๐Ž(๐ง!): Traveling salesperson

On the chart below you may find most common orders of growth of algorithms specified in Big O notation.

BONUS:

A way to remember which is most complex ๐Ÿ˜œ:

๐Ž(๐ฅ๐จ๐  ๐ง) = O(nice)
๐Ž(๐ง) = O(ok)
๐Ž(๐ง * ๐ฅ๐จ๐  ๐ง) = O(not nice)
๐Ž(๐งยฒ) = O(my)
๐Ž(๐ง!)= O(mg!)

--
๐Ÿ‘จโ€๐Ÿ’ป

๐Ÿ‘‰ I post daily about my data-journey and some tips and resources along the way. Followย David Regaladoย and ring the ๐Ÿ›Ž for more content.

#softwareengineering #computerscience
Post image by David Regalado

Related Influencers