insert a given time slot in a hash map.and do checking linearly te other time slot.if entry there in map.overlap/
correct me if its wrong..... On Thu, Apr 23, 2009 at 2:23 PM, Asif <[email protected]> wrote: > > Hi, > > I recently have been asked following algorithm question. > > > An employee has > 500 time cards on each day. These cards could have > erranous time card data like cards can be overlapped. There is a > solution present > for this problem but that runs in O(n2). We need to devise an > algorithm that should have time complexity in O(Xn). > > > Sample Time card data could be > > > In | Out // > 08:00 | 10:00 //Overallping with below time card > 09:00 | 11:00 //Overallping with above time card > 14:00 | 16:00 //Not overlapping > 16:00 | 17:00 //Not overlapping > > > Is there an efficient algorithm to do this in O(n + n, ...) > > Asif > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
