Greedy Algorithm for Egyptian Fraction
In early Egypt, people used to use only unit fraction (in the form of (1/n)) to represent the decimal numbers. The fraction was always written in the form 1/n , where the numerator is always 1 and denominator is a positive number. All other fractions were represented as the summation of the unit fractions. For […]
Greedy Solution to Activity Selection Problem.
Given n activities with their start and finish times. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time. You cannot perform the activity before it starts. The start and end times for each activity are fixed. […]
Job Sequencing with given deadline
Given n Jobs, with their deadline (between 1 to n) and associated profit. Each job takes unit time to complete and you will get the profit only (when the job is completed before the deadline. Sequence the jobs in a way that the profit is maximized.
Minimum number of platform required for a railway station
Given arrival and departure times of all trains for a particular railway station, write code to find the minimum number of platforms required on that railway station, so that all trains can run according to their schedule.