Input: n meetings A meeting e(i) has start time s(i) and finish time f(i). Sort n events based on there finish time f(i) Say sorted meeting(based on finishing time) are: e1,e2,e3,e4,...en
E(t): denotes the maximum no of meetings conducted where 0 <= time <= t. E(f1) = e1 E(f2) = max(E(s2) + 1), E(f1)); E(f3) = max(E(s3)+1), E(f2)); Make array of E based on finishing times. So your array will have values of E at different finishing times f1 E1 f2, E2 f3 E3 f4 E4 so E2 means maximum no of events between time >= f2 and < f3. Hope it is now clear. On Wed, Feb 9, 2011 at 12:59 PM, Sachin Agarwal <[email protected]>wrote: > didn't quite get it, can you please elaborate. > thanks > > On Feb 8, 10:38 pm, Ujjwal Raj <[email protected]> wrote: > > Use dynamic programming: > > 1) Sort the events in order of finishing time. > > f1, f2, f3, f4, ... fn > > > > E(fn) = E(sn) + 1; > > Solve the above recursion > > sn is start time of event n > > > > On Wed, Feb 9, 2011 at 11:30 AM, Sachin Agarwal > > <[email protected]>wrote: > > > > > > > > > > > > > > > > > Suppose I have a room and I want to schedule meetings in it. You're > > > given a list of meeting start and end times. Find a way to schedule > > > the maximum number of meetings in the room. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Algorithm Geeks" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]. > > > For more options, visit this group at > > >http://groups.google.com/group/algogeeks?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
