aboutsummaryrefslogtreecommitdiff

Algorithm Complexity Analyzer

A real-time algorithm complexity analyzer that uses AI to determine Big O notation and generates performance graphs through dynamic execution testing.

Algorithm Complexity Analyzer Gemini AI License

🚀 Features

  • AI-Powered Analysis: Uses Google's Gemini 2.5 Flash to analyze algorithm complexity
  • Multi-Language Support: Analyze algorithms written in JavaScript, Python, Go, and more
  • Real-Time Performance Testing: Dynamically executes code with varying input sizes
  • Adaptive Benchmarking: Automatically adjusts iterations to maintain optimal test duration
  • Interactive Visualization: Real-time performance graphs using Chart.js
  • Static Code Analysis: Detailed breakdown of algorithm structure and patterns

🔧 Installation

  1. Clone the repository:
git clone https://github.com/luciferreeves/complexity-analyzer.git
cd complexity-analyzer
  1. Install dependencies:
go mod download
  1. Set up environment variables:
cp .env.example .env

Edit .env and add your Gemini API key:

GEMINI_API_KEY=your-api-key-here
PORT=3000
  1. Run the application:
go run main.go
  1. Open your browser:
http://localhost:3000

🧠 How It Works

  1. AI Analysis: Gemini AI analyzes your code and determines:

  2. Time complexity notation

  3. Algorithm approach and patterns
  4. Appropriate test sizes

  5. Dynamic Testing: The system:

  6. Generates complete Go test program

  7. Runs algorithm with increasing input sizes
  8. Adaptively adjusts iterations
  9. Measures execution time with high precision

  10. Visualization: Results are displayed with:

  11. Complexity badge with confidence score
  12. Static analysis insights
  13. Interactive performance graph
  14. Detailed timing breakdown

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ using Go