Home > Back-end >  Computer curriculum design task
Computer curriculum design task

Time:10-07

The great god, there is a computer software program design task, want to help you a great god, and the request. Write a program, thank you!
(title). Greedy algorithm
Has a collection of E n activities, in which each activity requires the use of the same resource, such as the venue, while at the same time only one activity can use the resources, each activity has a I require the use of the resources the starting time of si and end time fi, if interval [si, fi] and [sj, fj] disjoint, the activity I and j is compatible, to code algorithm implementation in all the activities of the set, choose one of the largest collection of incompatible activities
1) input parameters such as n and the time of beginning and ending each activity
Greedy algorithm is used to solve the problem of arrangements, the 2) USES the arrangements for the optimal solution
3) the output of the final result,
  • Related