What is Algorithmic Complexity?

Topics covered
Popular Clips
Episode Highlights
Prime Numbers
Finding prime numbers efficiently presents significant challenges in algorithm design. explains that a naive approach, like checking each number up to two million, results in an inefficient n-squared algorithm. This method would take an impractical amount of time to find the 2,000,000th prime number. Instead, he suggests optimizing by checking divisibility only up to the greatest common divisor and keeping track of primes as you go, which can reduce the time complexity to n log n 1.
The obvious solution is terrible, and as you will, down even things that seem like it'd be really good, like dividing in half, like you would think would make a huge impact. Still going to run all night.
---
This highlights the importance of refining algorithms to achieve practical efficiency.
  Â
Sorting & Searching
Optimizing sorting and searching algorithms can significantly enhance performance. discusses the inefficiency of repeatedly searching through arrays, which can be improved by converting arrays to hash tables for constant-time lookups 2. This approach reduces time complexity but may increase space usage, especially with primitive data types.
If you convert that thing to a hash table which has constant lookup, then that's a huge savings time.
---
Understanding the trade-offs between time and space complexity is crucial for effective algorithm optimization 3.
Related Episodes
88. Algorithmic Complexity
Answers 383 questions

Algorithms You Should Know
Answers 383 questionsUnderstanding Complexity Theory
Answers 383 questions89. Does Big O Matter?
Answers 383 questionsGraph Algorithms
Answers 383 questions

Google's Engineering Practices - What to Look for in a Code Review
Answers 383 questions

Technical Challenges of Scale at Twitter
Answers 383 questionsClean Code - How to Write Amazing Functions
Answers 383 questions

Gitlab vs Github, AI vs Microservices
Answers 383 questionsShow Recursion Show
Answers 383 questions

Data Structures - Arrays and Array-ish
Answers 383 questions

Data Structures - (some) Trees
Answers 383 questionsDocker for Developers
Answers 383 questionsHow to be a Programmer
Answers 383 questionsWhy Date-ing is Hard
Answers 383 questions
