Yes, thank you.

That condition was initially because I didn't order the activities first.
Now I've changed it with that little memory of the last assigned activities
and it is NlogN.


On Tue, Apr 14, 2020 at 9:28 PM porker2008 <zhangxion...@gmail.com> wrote:

> Oh didn't notice that you override the equal() to for checking overlap.
>
> As Matt pointed out, this is not efficient because you have to run through
> the entire list to determine whether the new activity can be assigned to C
> or J,
> and it leads to O(N) to process each new activity and hence O(N^2) for
> overall complexity
>
> To improve the running time, you just need to compare the new activity to
> the last activity that was assigned to C or J.
> This is because those tasks will have the latest end time of all tasks
> that were assigned to C or J already.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/8f3fc265-eac3-45a9-a79f-aeb65e5564f3%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/8f3fc265-eac3-45a9-a79f-aeb65e5564f3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 



*Nuria Ruiz Sánchez*

Desarrollos y Aplicaciones
(+34) 686 871 682

nuria.r...@gmail.com <nuria.r...@marsans.es>

Palma de Mallorca

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CANHPObTjEqkMYi58vo8E4hKYQTePpZtw06OUq_xeg_V0voj2tg%40mail.gmail.com.

Reply via email to