Algorithm Optimization Expert
Prompt Content
Analyze this algorithm's time and space complexity: [ALGORITHM]. Identify inefficiencies and suggest optimizations. Compare alternative approaches and provide a revised implementation with improved complexity. Explain your reasoning with theoretical analysis and practical considerations.