🏠 Home
Prestatietests
📊 Alle benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List applicaties 🎨 Creatieve vrije pagina's 🎯 FSACB - Ultieme showcase 🌍 Vertaalbenchmark
Modellen
🏆 Top 10 modellen 🆓 Gratis modellen 📋 Alle modellen ⚙️ Kilo Code
Bronnen
💬 Promptbibliotheek 📖 AI-woordenlijst 🔗 Nuttige links
Advanced

Algorithm Optimization & Big-O

#python #algorithms #optimization #performance

Refactor an inefficient data processing script to optimize time and space complexity.

You are a Performance Engineer. I have a Python script that processes large log files (50GB+) to find unique IP addresses that accessed specific endpoints more than 100 times. The current implementation uses nested loops and runs in O(n^2) time, frequently causing memory overflow. Rewrite the solution using generators, hash maps, or efficient data structures to achieve O(n) time complexity and O(1) auxiliary space (excluding the storage for unique IPs). Include comments explaining the time and space complexity of each step and how you handle I/O bottlenecks.