Use sweep line approach.
Store start and finish points of the intervals and deal with is as
events -
starting point introduces new interval (place it into a set or an
appropriate DS, call it active set),
second point - removes previously inserted interval from the active
set.
Sort events in increasing order.
When you reach starting point, all intervals from active set are
conflicted with the current.

On Dec 4, 7:43 am, Prims <topcode...@gmail.com> wrote:
> You are given 'n' appointments. Each appointment contains startime and
> endtime. You have to retun all conflicting appointments efficiently
>
> starttime and endtime can range from a few min to few years.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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.

Reply via email to