No, it is only O(n), but space will be order of O(maximum element in the 
range)

Because only one loop to go through all the intervals and get the maximum.

Then allocate space for that much, after that again go through intervals 
and increment the corresponding value.

Then after that finding maximum can be done in again O(n).

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to