[algogeeks] segment Tree problem

2012-06-27 Thread amrit harry
Hi. I'm new to segment tree. im solving a problem in which we have to find most frequent element in given range so for the below testcase im trying to constructing tree but i stuck. -1 -1 1 1 1 1 3 8 8 8 [i,j] is range of segment and x is the element that occur frequently and y is the count of

[algogeeks] segment tree problem (spoj GSS1)

2012-02-06 Thread Anshul AGARWAL
hii friend.. its my first segment tree problem.but i get WA in 10 test case..all the test case that i try i got correct answer..can any one find bug in program and correct me plz problem http://www.spoj.pl/problems/GSS1/ algo-- i use segment tree My solution.. #include #include using namespace s

Re: [algogeeks] segment tree

2012-01-21 Thread arun kumar
this link deal with applying lazy propagation for the problem LITE in spoj. hope this one help you http://apps.topcoder.com/forums/?module=Thread&threadID=690098&messageID=1298729&mc=8&view=tree#1298729 regards arun On Sat, Jan 21, 2012 at 6:10 PM, UTKARSH SRIVASTAV wrote: > Hi can anyone please

[algogeeks] segment tree

2012-01-21 Thread UTKARSH SRIVASTAV
Hi can anyone please give a good link to study lazy propagation in segment tree with example or code. I know segment tree but not about lazy propagation. -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups "

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, visi

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 wrote: > > > On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal wrote: > >> implement segment tree with lazy propagation :) >> > > What do you mean by lazy propagation ? > > -- >> Sunny Aggrawal >> B.Tech. V year,CSI >> Indian In

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal wrote: > 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 subscribed to th

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 sunny agrawal
implement segment tree with lazy propagation :) On Tue, Sep 27, 2011 at 1:19 PM, Aamir Khan 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 ? > > #include > #include > > struct

[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 ? #include #include struct node{ int l; int r; bool el ; node *left; node *right; }; struct node *build(int l, int r) { str

[algogeeks] SEGMENT TREE: WA

2011-08-02 Thread Amol Sharma
hi, i attempted the problem http://www.spoj.pl/problems/GSS1/ i have the solved the problem using segment trees.i have the checked my solution for the most of the cases it is working fine.but i am getting WA...plz tell any case where my code fails !!.please point out the bug if a

[algogeeks] segment tree

2011-07-04 Thread geek forgeek
-- Forwarded message -- From: geek forgeek Date: Mon, Jul 4, 2011 at 2:58 PM Subject: segment tree To: algog...@googlegroups.com can any1 plz tell some gud tutorial for segment tree? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"