yes good point pointed by atul it works only for positive numbers in matrix
for negative numbers we have to consider maximum continuous sum for that
row starting with that element
On Tue, Jan 17, 2012 at 10:28 AM, atul anand atul.87fri...@gmail.comwrote:
@UTKARSH :
my approach is similar to
answer to this post has not yet been answered ...i.e abt complexity.
seems log(n) to me..
correct me if i am wrong.
On Mon, Jan 16, 2012 at 8:53 AM, Gene gene.ress...@gmail.com wrote:
I'm sorry for not being specific. I meant it doesn't converge for all
roots, e.g. cube root.
On Jan 15,
/* test.c */
#include stdio.h
#include ctype.h
void fn(int x, int y);
int main(void)
{
int a = 4;
int b = -4;
printf([%s, %s, %c]\n, \12 3, \123, \123);
printf([a: %d, b: %d]\n, a-1, b1);
printf(Mod variants: 5,3 [Q: %2d, R: %2d]\n, 5/3, 5%3);
printf(Mod variants: -5,3 [Q: %2d, R:
#includestdio.h
int main()
{ printf(hello);
fork();
printf(world);
}
what will be the o/p
on my system...its showing hello world hello world...
but i think it could be hello world two times in any order.
please tell me what is the exact o/p...
#includestdio.h
int main()
{
int i=0;
printf(helllo world %d\n,i);
i++;
fork(); //Fork Exeution Starts from here .
printf(hello forking %d\n,i);
i++;
}
o/p:-
helllo world 0
hello forking 1
hello forking 1
On 1/17/12, himanshu kansal
#includestdio.h
int main()
{
int i=0;
printf(hello world \n);
i++;
fork();
printf(forking %d,i);
i++;
}
o/p :-
hello world
Can any1 explain this??
On 1/17/12, Durgesh Kumar durgesh1...@gmail.com wrote:
How can we join after the forking
On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar durgesh1...@gmail.comwrote:
#includestdio.h
int main()
{
int i=0;
printf(hello world \n);
i++;
fork();
printf(forking %d,i);
i++;
}
o/p :-
hello world
Can any1 explain this??
On 1/17/12,
answered by sunny. and output you mentioned is also wrong. search archives.
On Tue, Jan 17, 2012 at 5:31 PM, shady sinv...@gmail.com wrote:
On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar durgesh1...@gmail.comwrote:
#includestdio.h
int main()
{
int i=0;
printf(hello world
0
On 1/16/12, Ravi Ranjan ravi.cool2...@gmail.com wrote:
An ant moves on a regular grid of squares that are coloured either black or
white.
The ant is always oriented in one of the cardinal directions (left, right,
up or down) and moves from square to adjacent square according to the
You are given an array which represents the heights of every bar of a
histogram. Now all these bars are contiguous (juxtaposed wrt each other)
and have the same width. For Example, A={2,1,4} represents a histogram
having 3 bars of height 2,1and 4 in that order. Now you need to find a
rectangle in
@sravan . u missed man ..read again what i said , u r calculating 3^a[i] ,
where is 3 comes in to picture , no array has has 3 ?? correct , its should
be 2^a[i] , then we search 2 in 2nd array if found 2 the go ahead, read
the algo suggested above , its should work . let me know whats your
@all
Using Newton's method as described above, the time complexity of
calculating a root of a function f(x) with n-digit precision, provided that
a good initial approximation is known, is O((\log n) F(n)) where F(n) is
the cost of calculating f(x)/f'(x)\, with n-digit precision.
However,
find the lowest height of the bar multiply it with the number of the bars
in graph. it would be the minimum area.
On Tue, Jan 17, 2012 at 5:33 PM, Ashish Goel ashg...@gmail.com wrote:
You are given an array which represents the heights of every bar of a
histogram. Now all these bars are
sorry for last comment i misunderstand the problem.
On Tue, Jan 17, 2012 at 5:54 PM, amrit harry dabbcomput...@gmail.comwrote:
find the lowest height of the bar multiply it with the number of the bars
in graph. it would be the minimum area.
On Tue, Jan 17, 2012 at 5:33 PM, Ashish Goel
-
||
||
-
| |||
| |||
--
| |||
| |||
--
||
||
--
Set 1-8 in these 8 boxese such that consecutive numbers wont intersect
vertically/horizontally or diagonally
Set 1-8 in
read my reply on a post of maximum rectangle yesterday
On 1/17/12, amrit harry dabbcomput...@gmail.com wrote:
sorry for last comment i misunderstand the problem.
On Tue, Jan 17, 2012 at 5:54 PM, amrit harry dabbcomput...@gmail.comwrote:
find the lowest height of the bar multiply it with the
Can you explain the size of inputs?
I think that Coordinate's Compression can solved this
2012/1/17 UTKARSH SRIVASTAV usrivastav...@gmail.com
read my reply on a post of maximum rectangle yesterday
On 1/17/12, amrit harry dabbcomput...@gmail.com wrote:
sorry for last comment i misunderstand
@Shashank: can you look at the first post from you?
you are calculating 3^a[i] adding it to the sum,
can you write a pseudocode so that none of gets confused.
(also, if you are saying this.
for each element, raise element to the power of 2 (2^a[i]), (like you said
in above post), or 3, like
I agree with Gene,
10^80 is of very larger magnitude, and is no way possible to solve given
any amount of time,
He might be testing you to '*think it practically before jumping to answer
the question*' (or) he/you must have gone wrong somewhere.
(even to read that input it takes for ever..)
hey, does the question allows a consecutive number to lie at non adjacent
vertical/horizontal/diagonal position??
On Tue, Jan 17, 2012 at 9:26 PM, atul anand atul.87fri...@gmail.com wrote:
-
||
| 7 |
-
|4 || 3 |
| | 1 ||
--
|
@ WgpShashank :
considering your latest comment abt you algo...
/*
i didn't get how my approach will fail , can u check for the exmple u said
? if u sum the 1st array using 2 as base then sum will be 3 (*exculding 2 ,
although it won't metter* ) , then u search that elemnt in 2nd array , u
@anika : i guess.if your concern is allowed then i dont think so we can
solve this problem.
On Tue, Jan 17, 2012 at 9:59 PM, Anika Jain anika.jai...@gmail.com wrote:
hey, does the question allows a consecutive number to lie at non adjacent
vertical/horizontal/diagonal position??
On Tue,
@atul: yes i agree with you.. hmm..
On Tue, Jan 17, 2012 at 10:21 PM, atul anand atul.87fri...@gmail.comwrote:
@anika : i guess.if your concern is allowed then i dont think so we
can solve this problem.
On Tue, Jan 17, 2012 at 9:59 PM, Anika Jain anika.jai...@gmail.comwrote:
hey, does
btw no need to solve this problem using hit and trial...
idea here is from 1-8 , 1 and 8 are only number whose adjacent elements are
1(1 adjacent 2 , 8 has adjacent 7).
whereas rest of the element has 2 adjacent element
so it would be best to keep 1,8 bcozz they are the only elements who has
only
correction above:
so it would be best to keep 1,8 at center.
On Tue, Jan 17, 2012 at 10:36 PM, atul anand atul.87fri...@gmail.comwrote:
btw no need to solve this problem using hit and trial...
idea here is from 1-8 , 1 and 8 are only number whose adjacent elements
are 1(1 adjacent 2 , 8 has
Questions on BIT
http://problemclassifier.appspot.com/index.jsp?search=BITusr=
want questions on segment tree
http://problemclassifier.appspot.com/index.jsp?search=treeusr=
On Sun, Jan 15, 2012 at 7:58 PM, Amol Sharma amolsharm...@gmail.com wrote:
also try
120
On Jan 17, 5:59 am, Umer Farooq the.um...@gmail.com wrote:
0
On 1/16/12, Ravi Ranjan ravi.cool2...@gmail.com wrote:
An ant moves on a regular grid of squares that are coloured either black or
white.
The ant is always oriented in one of the cardinal directions (left, right,
+1 Jaimedp
On Jan 17, 1:05 pm, jaimedp jaim...@gmail.com wrote:
120
On Jan 17, 5:59 am, Umer Farooq the.um...@gmail.com wrote:
0
On 1/16/12, Ravi Ranjan ravi.cool2...@gmail.com wrote:
An ant moves on a regular grid of squares that are coloured either black
or
white.
The
Hi atul:
Can u give the complexity for ur algorithm.
I think of an O(m^2n^2) =~ O(n^4) algorithm, with constant space.
The kadane's algo should be applied on a 2-d data right.. that takes the
complexity to order of 2.
--
You received this message because you are subscribed to the Google
@sravanreddy001 : complexity would be :
O(R^2 * C)
where R and C are no. of rows and column respectively.
On Wed, Jan 18, 2012 at 9:30 AM, sravanreddy001 sravanreddy...@gmail.comwrote:
Hi atul:
Can u give the complexity for ur algorithm.
I think of an O(m^2n^2) =~ O(n^4) algorithm, with
@atul:
on the first look, even I thought the same.. O(log N).. and this is may be
true for the given precision.
*[-- the following may not be related to given qn.] -- but.. can u comment
on this view point..*
but.. I am thinking that, the complexity is dependent on the level of
precision
@himanshu:
from the line after fork().
(as I assume, even the program counter is copied with the same value.)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@sravanreddy001 : and kadane algo will be applied to each row.
after finding cumulative sum.
at each row , apply kadane algo (here we are considering that matrix could
be anywhere starting from row=0 i.e it can be b/w row = 0 to row=1 or row
=0 to row=2 , row=0 to row=3...etc ).
find maxsum and
@atul.. let me tell you ., i told that we can send
u took two array
arr[]={2,0,0,0}
arr2[]={2,-2,1,0};
take 2 as a base in 1st array , calculate sum (exclduing 2 ), calculate
base^arr[i] that gives sum1= 3
sorting not allowed , just search linearly 2 in 2nd array e.g. search the
same
34 matches
Mail list logo