Smart Task Scheduler is a Java-based web application that demonstrates the practical application of Data Structures and Algorithms using a real-world task scheduling problem.
The system intelligently schedules and executes tasks using a Priority Queue with a custom comparator, and is built using Java Servlets deployed on Apache Tomcat.
The Smart Task Scheduler allows users to add tasks with multiple constraints such as priority, deadline, and duration.
Tasks are automatically ordered using a greedy scheduling strategy to ensure optimal execution order.
This project focuses on:
- Core Java fundamentals
- Algorithmic problem solving
- Servlet lifecycle and backend web development
- Manual deployment on Apache Tomcat
- Add tasks with:
- Task Name
- Priority (1–5 scale, lower value = higher priority)
- Duration
- Deadline
Tasks are scheduled using a custom comparator based on:
- Priority (Primary criterion)
- Deadline (Earlier deadlines first)
- Duration (Shorter tasks first)
This ensures efficient and optimal scheduling decisions.
- Tasks are executed in the correct order by polling from a
PriorityQueue - Time complexity: O(log n) per insertion/removal
- Data Structure:
PriorityQueue - Algorithm Strategy: Greedy Scheduling
- Comparator Logic: Multi-criteria comparison (Priority → Deadline → Duration)
This demonstrates how DSA concepts can be applied to real backend systems.
The application follows the MVC (Model-View-Controller) design pattern:
- Controller Layer
- Java Servlets handle HTTP requests and responses
- Service Layer
- Business logic for task scheduling and execution
- Model Layer
- Task entity
- Utility Layer
- Custom
TaskComparatorand helper classes
- Custom
- AddTaskServlet – Add new tasks
- ViewTasksServlet – View scheduled tasks
- ExecuteTaskServlet – Execute tasks in optimal order
- Uses in-memory storage via
ServletContext - Demonstrates shared application state across multiple HTTP requests
- No database used (intentional for algorithm-focused design)
- Java (Core Java, Collections)
- Java Servlets
- Apache Tomcat (XAMPP)
- PriorityQueue & Custom Comparator
- HTML (basic views)
- Manually compiled Java classes using
javac - Deployed on Apache Tomcat via XAMPP
- Application runs on:
http://localhost:8080/SmartTaskScheduler
- Hands-on experience with Java Servlets and Tomcat
- Practical use of Data Structures & Algorithms
- Understanding of servlet lifecycle and application context
- Experience with manual compilation and deployment
- Backend problem-solving using greedy strategies
- Database integration (MySQL)
- Annotation-based servlets
- WAR file packaging
- Authentication and session handling
This project is for educational and learning purposes.