Re: [algogeeks] Re: Meetings puzzle

2011-03-02 Thread Ashish Goel
How is E(s2) is calculated? Why E(S2)+1

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote:

 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 sachinagarwa...@gmail.com
  wrote:

 didn't quite get it, can you please elaborate.
 thanks

 On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com 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
  sachinagarwa...@gmail.comwrote:
 
 
 
 
 
 
 
   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 algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Meetings puzzle

2011-02-09 Thread Ujjwal Raj
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
sachinagarwa...@gmail.comwrote:

 didn't quite get it, can you please elaborate.
 thanks

 On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com 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
  sachinagarwa...@gmail.comwrote:
 
 
 
 
 
 
 
   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 algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar Bindal
what are f1, f2, f3,...?

On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote:

 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 sachinagarwa...@gmail.com
  wrote:

 didn't quite get it, can you please elaborate.
 thanks

 On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com 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
  sachinagarwa...@gmail.comwrote:
 
 
 
 
 
 
 
   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 algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 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 algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Tushar Bindal
Computer Engineering
Delhi College of Engineering
Mob: +919818442705
E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar
sorry.
did not go thru it thoroughly earlier.
got it now.

On Feb 9, 7:35 pm, Tushar Bindal tushicom...@gmail.com wrote:
 what are f1, f2, f3,...?



 On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote:
  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 sachinagarwa...@gmail.com
   wrote:

  didn't quite get it, can you please elaborate.
  thanks

  On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com 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
   sachinagarwa...@gmail.comwrote:

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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
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 algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  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 algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob:+919818442705begin_of_the_skype_highlighting+919818442705  end_of_the_skype_highlighting
 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Meetings puzzle

2011-02-08 Thread Sachin Agarwal
didn't quite get it, can you please elaborate.
thanks

On Feb 8, 10:38 pm, Ujjwal Raj ujjwal@gmail.com 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
 sachinagarwa...@gmail.comwrote:







  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 algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.