Python Program to Minimize Lateness using Greedy Algorithm

This is a Python program to minimize maximum lateness using greedy algorithm. Problem Description We are given n requests numbered 0 to n – 1. Each request i has a time that it takes to complete t(i) and a deadline d(i). If a request i starts at time s(i), then its finish time is f(i) … Read more

advertisement

Python Program to Find the Smallest Set of Unit-Length Closed Intervals using Greedy Algorithm

This is a Python program to find smallest set of unit-length closed intervals that contains all points using greedy algorithm. Problem Description We are given a set of points on the x-axis. We have to find the minimum number of closed intervals of length 1 that will contain all of these points. Problem Solution 1. … Read more

advertisement

Python Program to Solve Interval Scheduling Problem using Greedy Algorithm

This is a Python program to solve the interval scheduling problem using greedy algorithm. Problem Description In the interval scheduling problem, we are given n activities numbered 0 to n – 1. Each activity i has a start time s(i) and a finish time f(i). Two activities i and j are mutually compatible if s(i) … Read more

advertisement

Python Program to Solve Fractional Knapsack Problem using Greedy Algorithm

This is a Python program to solve the fractional knapsack problem using greedy algorithm. Problem Description In the fractional knapsack problem, we are given a set of n items. Each item i has a value v(i) and a weight w(i) where 0 <= i < n. We are given a maximum weight W. The problem … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.