88. Algorithmic Complexity

Topics covered
Popular Clips
Episode Highlights
Efficient Ops
In the realm of algorithmic complexity, certain operations demonstrate remarkable efficiency even as input sizes grow. Joe Zack illustrates this with a scenario where twelve operations can handle 4096 inputs, and twenty operations can manage over a million inputs, showcasing the power of linear complexity 1. Michael Outlaw adds that while some algorithms may not be perfectly linear, they can still significantly outperform quadratic complexity, especially in practical applications 2.
For example, for that 1000 input size, the n squared was 1 million seconds. This is 10,000 seconds.
--- Michael Outlaw
Such efficiency is crucial in scenarios like interviews, where demonstrating an understanding of reducing complexity from n squared to n log n can be advantageous 2.
O(n) Complexity
Understanding O(n) complexity is essential for evaluating algorithm performance. Joe Zack explains that O(n) operations grow linearly with input size, meaning the time taken increases proportionally as inputs increase 3. This is exemplified by tasks like summing an array or finding the smallest element, where each element must be accessed 4.
If you're looping over a collection and you're hitting every item in the collection, you're automatically O(n).
--- Joe Zack
Michael Outlaw notes that even if an algorithm only examines a portion of the input, it remains O(n) due to the constant factor being ignored in complexity calculations 4.
Related Episodes

What is Algorithmic Complexity?
Answers 383 questions89. Does Big O Matter?
Answers 383 questionsUnderstanding Complexity Theory
Answers 383 questions

Algorithms You Should Know
Answers 383 questionsGraph Algorithms
Answers 383 questionsClean Code - How to Write Amazing Functions
Answers 383 questionsDesigning Data-Intensive Applications – Scalability
Answers 383 questionsHow to be a Programmer
Answers 383 questionsHow to be an Advanced Programmer
Answers 383 questions87. Thunder Talks
Answers 383 questionsDesign Patterns Part 1
Answers 383 questions95. Data Structures – Arrays and Array-ish
Answers 383 questionsHow to be an Intermediate Programmer
Answers 383 questions

Technical Challenges of Scale at Twitter
Answers 383 questionsStackOverflow AI Disagreements, Kotlin Coroutines and More
Answers 383 questions













