A full-stack web application that analyzes code complexity and evaluates mathematical expressions using core data structures.
This project demonstrates the real-world application of Data Structures (Stack) by building:
- ๐ข Expression Evaluator (Infix, Prefix, Postfix)
- ๐ Code Complexity Analyzer (loop depth & estimation)
The system is built using a C++ backend (Crow) and a Node.js server, with a responsive web interface.
- Stack (Expression Evaluation)
- Parsing & Conversion Algorithms
- Time Complexity Estimation
- REST API Design
- C++
- Crow Framework
- Custom logic for parsing & evaluation
- Node.js
- Express.js
- Axios
- EJS
- Bootstrap 5
- Font Awesome
Browser (UI)
โ
Node.js (Express Server)
โ
C++ API (Crow)
โ
Data Structure Logic (Stack / Analysis)
-
Supports:
- Infix
- Prefix
- Postfix
-
Converts between formats
-
Evaluates final result
-
Counts:
- for loops
- if / else
- while loops
-
Calculates:
- Maximum nesting depth
- Estimated time complexity
-
Structured JSON responses
-
Handles:
- Invalid expressions
- Empty input
- Division by zero
- Invalid code input
{
"expression": "5 6 2 * + 3 -"
}{
"result": 14,
"prefix": "- + 5 * 6 2 3",
"infix": "((5 + (6 * 2)) - 3)",
"postfix": "5 6 2 * + 3 -"
}{
"code": "for(int i=0;i<n;i++){...}"
}{
"for": 1,
"if": 0,
"while": 0,
"maxDepth": 1,
"estimatedComplexity": "O(n)"
}The API has been tested using:
- Curl
- Browser integration
Test cases include:
- Valid expressions
- Invalid inputs
- Edge cases (empty input, divide by zero)
- Nested loops for complexity
git clone https://github.com/your-username/your-repo.git
cd your-reponpm installg++ main.cpp -o app -lpthread
./appnode index.jshttp://localhost:3000/home
- Live evaluation (no page reload)
- Expression history
- Step-by-step stack visualization
- Support for variables
Subhranil Mandal
This project is for educational purposes.
- Add hover effects on result cards
- Add smooth animations and transitions
- Improve mobile responsiveness
- Add icons for loops, conditions, complexity, etc.
- Add loading states while analyzing
- Add toast notifications for errors/success
- Add dark/light theme toggle
- Improve typography and spacing consistency
- Add bar chart for loop/condition counts
- Add pie chart for code structure distribution
- Add complexity visualization meter
- Add nesting depth tree visualization
- Add execution flow visualization
- Add expression conversion step visualization
- Step-by-step infix to postfix conversion
- Stack visualization during conversion
- Expression tree generation
- Expression validation with error highlighting
- Support variables and functions
- Support advanced mathematical operators
- Add expression evaluation support
- Better time complexity detection
- Space complexity estimation
- Detect recursion
- Detect nested loops more accurately
- Detect switch/case statements
- Detect functions/classes
- Detect unreachable code
- Detect infinite loops
- Add cyclomatic complexity analysis
- Add code smell detection
- Syntax highlighting
- Monaco editor integration
- File upload support
- Export analysis report as PDF
- Save analysis history
- Authentication system
- AI-based code suggestions
- Real-time analysis while typing
- C++
- Java
- Python
- JavaScript
- Analysis statistics dashboard
- Previous analysis history
- Complexity trend graphs
- Most used structures analytics
- User performance analytics
- Git visualizer
- Regex engine visualizer
- Debugger simulation
- AST (Abstract Syntax Tree) visualization
- Compiler pipeline visualization
- Memory/stack visualization
- Tokenizer visualization
- Optimize parser speed
- Improve large code handling
- Lazy rendering for large outputs
- Better state management
- Backend optimization
- Turn project into a complete developer toolkit
- Add interactive learning mode
- Add DSA visualization support
- Add competitive programming utilities
- Add collaborative sharing features
- Add plugin architecture for custom analyzers



