Jan 20, 2009

Given two events with integer start and end times, E1 = (s1, e1), E2 = (s2, e2), implement a quick boolean check to see if the events overlap.

Given two events with integer start and end times, E1 = (s1, e1), E2 = (s2, e2), implement a quick boolean check to see if the events overlap.
s1 < e2 && s2 < e1
or
!((e1 < s2)||(e2 < s1))

No comments:

Post a Comment