Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package specialproject;
- // Program to find the maximum profit job sequence from a given array of jobs with deadlines and profits
- // A structure to represent a job
- public class Job
- {
- public int jobID; // Job Id
- public int deadline; // Deadline of job
- public int profit; // Profit if job is over before or on deadline
- Job(int i, int d, int p) {
- this.jobID =i;
- this.deadline = d;
- this.profit = p;
- }
- public int getId() {
- return jobID;
- }
- public int getDeadline() {
- return deadline;
- }
- public int getProfit() {
- return profit;
- }
- @Override
- public String toString() {
- return "Job{" + "id=" + jobID + ", deadline=" + deadline + ", profit=" + profit + '}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement