public static void main(String args[]){
        Job jobs[] = new Job[6];
        jobs[0] = new Job(1,3,5);
        jobs[1] = new Job(2,5,6);
        jobs[2] = new Job(4,6,5);
        jobs[3] = new Job(6,7,4);
        jobs[4] = new Job(5,8,11);
        jobs[5] = new Job(7,9,2);
        WeightedJobSchedulingMaximumProfit mp = new WeightedJobSchedulingMaximumProfit();
        System.out.println(mp.maximum(jobs));
    }
Sort the jobs by finish time.
For every job find the first job which does not overlap with this job
and see if this job profit plus profit till last non overlapping job is greater
than profit till last job.
@param jobs
@return
src/com/interview/dynamic/WeightedJobSchedulingMaximumProfit.java