Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Job Sequencing Algorithm in C++ #2882

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 25, 2024

  1. feat: Add Job Sequencing Algorithm in C++

    - Implemented the Job Sequencing Algorithm using a greedy approach to maximize profit by scheduling jobs within their respective deadlines.
    - Added `jobSequencing()` function which takes an array of jobs (each with an ID, deadline, and profit) and schedules them based on highest profit within the available deadlines.
    - The algorithm sorts jobs by profit and iteratively assigns them to the latest available slots, aiming to maximize the total profit.
    - Included comments to explain the structure of the algorithm, sorting, and scheduling logic for clarity.
    
    Example Input:
      Jobs = { {'a', 2, 100}, {'b', 1, 19}, {'c', 2, 27}, {'d', 1, 25}, {'e', 3, 15} }
    
    Expected Output:
      Job sequence for maximum profit: a c e 
      Total Profit: 142
    
    This implementation improves the repository by adding an essential scheduling algorithm, providing learners with a practical example of greedy algorithms in C++.
    sneha0099 authored Oct 25, 2024
    Configuration menu
    Copy the full SHA
    e12b299 View commit details
    Browse the repository at this point in the history