[algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
I am trying to solve http://www.spoj.pl/problems/LITE/ using segment tree. Here's the code but i am getting TLE. Can somebody help me to optimize the code ? #includecstdio #includealgorithm struct node{ int l; int r; bool el ; node *left; node *right; }; struct node *build(int l,

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread sunny agrawal
implement segment tree with lazy propagation :) On Tue, Sep 27, 2011 at 1:19 PM, Aamir Khan ak4u2...@gmail.com wrote: I am trying to solve http://www.spoj.pl/problems/LITE/ using segment tree. Here's the code but i am getting TLE. Can somebody help me to optimize the code ? #includecstdio

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Tamanna Afroze
The code is already optimized... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: implement segment tree with lazy propagation :) What do you mean by lazy propagation ? -- Sunny Aggrawal B.Tech. V year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread shady
http://tinyurl.com/6gqun4u On Tue, Sep 27, 2011 at 2:32 PM, Aamir Khan ak4u2...@gmail.com wrote: On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: implement segment tree with lazy propagation :) What do you mean by lazy propagation ? -- Sunny Aggrawal

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Tamanna Afroze
nice link:: @shady -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit