ahh yes, as prakhar says, if the array is bitonic, my approach will work
for O(log n).
On Sun, Jun 24, 2012 at 1:57 AM, Prakhar Jain jprakha...@gmail.com wrote:
I think it can't be done in O(log n) as per given problem constraints.
It can be done in O(log n) if additional information that
@Hassan
According to the algorithm there is no peak for 2 ,3,1,7 ,8 ,10 ,12 .
but there is one 3 .
Regards
Rajesh Pandey
On Sun, Jun 24, 2012 at 1:57 AM, Prakhar Jain jprakha...@gmail.com wrote:
I think it can't be done in O(log n) as per given problem constraints.
It can be done in
@sourabh
notice the definition of peak in the link given earlier.
it says that peak element would not be smaller than its neighbours implying
that it can be equal to them and still qualify for a peak.
hence the given algo would work in the sample given by you or any other
sample.
On Sun, Jun 24,
The idea behind this O(log n) Divide conquer algorithm is they assumed
that element before the first element and after the last element is
-infinite. So, they can they always pick the locally rising element ;since,
even if the array continues to increase in that half, the last element can
be the
+ Prakhar Jain
On Sun, Jun 24, 2012 at 2:03 PM, Prakhar Jain jprakha...@gmail.com wrote:
The idea behind this O(log n) Divide conquer algorithm is they assumed
that element before the first element and after the last element is
-infinite. So, they can they always pick the locally rising
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/xM3mGdcfvi4J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
can any one expain for 2-D??
On Sun, Jun 24, 2012 at 3:24 PM, Hassan Monfared hmonfa...@gmail.comwrote:
+ Prakhar Jain
On Sun, Jun 24, 2012 at 2:03 PM, Prakhar Jain jprakha...@gmail.comwrote:
The idea behind this O(log n) Divide conquer algorithm is they assumed
that element before the
please suggest something :
Problem :
http://www.spoj.pl/problems/EASYMATH/
C++ code :
http://ideone.com/r2OSb
was getting wrong ans due to over flow i think in LCM() for big prime's i guess.
thin tried in python .
Now getting NZEC for python code which mean's high level or recurrsion
some
use return (a/gcd(a,b)*b instead
On Sun, Jun 24, 2012 at 7:10 PM, Sourabh Singh singhsourab...@gmail.comwrote:
please suggest something :
Problem :
http://www.spoj.pl/problems/EASYMATH/
C++ code :
http://ideone.com/r2OSb
was getting wrong ans due to over flow i think in LCM() for big
code:-
http://ideone.com/yMQSK
--
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
can find one more solution in my blog
http://pandey123.wordpress.com/
check it... and tell me if you have any doubt...
On Sat, Jun 23, 2012 at 11:52 PM, Akshat Sapra sapraaks...@gmail.comwrote:
To do this question in O(n) time follow the post Segment trees in this
post of topcoder
dont post codes, ask whether your algorithm is correct or not.
On Sun, Jun 24, 2012 at 8:29 PM, Hassan Monfared hmonfa...@gmail.comwrote:
use return (a/gcd(a,b)*b instead
On Sun, Jun 24, 2012 at 7:10 PM, Sourabh Singh
singhsourab...@gmail.comwrote:
please suggest something :
Problem
@hemesh, amol = correct solutions
ABCDEF another problem on SPOJ, incase people want to try.
On Sun, Jun 24, 2012 at 2:13 AM, Sourabh Singh singhsourab...@gmail.comwrote:
@ Amol Sharma
thanx got it..
yup, overlooked those case's :-) my bad..
On Sat, Jun 23, 2012 at 1:31 PM, Amol Sharma
@rahul: the ques itself says that we have to implement abstract class*without
* using pure virtual function...
On Sun, Jun 24, 2012 at 12:00 AM, rahul sharma rahul23111...@gmail.comwrote:
yeah use pure virtual fxn..
On Fri, Jun 22, 2012 at 3:41 PM, himanshu kansal
14 matches
Mail list logo