One Byte Explainer: Big O notation

This is a submission for DEV Computer Science Challenge v24.06.12: One Byte Explainer.

Explainer

My code runs in seconds for 3 inputs but takes hours for 100, why? Consider: 3 people can all shake hands in 3 exchanges. But for 100 people (…


This content originally appeared on DEV Community and was authored by David Haley

This is a submission for DEV Computer Science Challenge v24.06.12: One Byte Explainer.

Explainer

My code runs in seconds for 3 inputs but takes hours for 100, why? Consider: 3 people can all shake hands in 3 exchanges. But for 100 people (33x) it takes 4,950 (1650x)! Big O math represents runtime’s growth at scale by only keeping its main factors.

Additional Context

TEAM MEMBERS: @dchaley @lynnlangit


This content originally appeared on DEV Community and was authored by David Haley


Print Share Comment Cite Upload Translate Updates
APA

David Haley | Sciencx (2024-06-23T03:01:40+00:00) One Byte Explainer: Big O notation. Retrieved from https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/

MLA
" » One Byte Explainer: Big O notation." David Haley | Sciencx - Sunday June 23, 2024, https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/
HARVARD
David Haley | Sciencx Sunday June 23, 2024 » One Byte Explainer: Big O notation., viewed ,<https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/>
VANCOUVER
David Haley | Sciencx - » One Byte Explainer: Big O notation. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/
CHICAGO
" » One Byte Explainer: Big O notation." David Haley | Sciencx - Accessed . https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/
IEEE
" » One Byte Explainer: Big O notation." David Haley | Sciencx [Online]. Available: https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/. [Accessed: ]
rf:citation
» One Byte Explainer: Big O notation | David Haley | Sciencx | https://www.scien.cx/2024/06/23/one-byte-explainer-big-o-notation/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.