Skip to content

luciferreeves/complexity-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

    • Time complexity notation
    • Algorithm approach and patterns
    • Appropriate test sizes
  2. Dynamic Testing: The system:

    • Generates complete Go test program
    • Runs algorithm with increasing input sizes
    • Adaptively adjusts iterations
    • Measures execution time with high precision
  3. Visualization: Results are displayed with:

    • Complexity badge with confidence score
    • Static analysis insights
    • Interactive performance graph
    • 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