Re: [algogeeks] probabilty

2011-08-05 Thread Arun Vishwanathan
he speaks the truth 1/4 time...the probability of 6 is 1/6so isnt it just 1/4*1/6=1/24?? On Fri, Aug 5, 2011 at 12:54 PM, Nitin Nizhawan wrote: > yes it cant be 1/8 I was wrong. > > > On Fri, Aug 5, 2011 at 4:23 PM, coder dumca wrote: > >> i think it should be 3/4 >> >> >> On Fri, Aug 5,

Re: [algogeeks] max product of a subarray

2011-08-05 Thread Arun Vishwanathan
my wrong I guess yr 3rd point takes care of this... apologies On Fri, Aug 5, 2011 at 11:03 AM, Arun Vishwanathan wrote: > it is difficult to read code and understand but based on the logic u > mentioned in 3 points i just want to know if u also have taken care of the > case where >

Re: [algogeeks] max product of a subarray

2011-08-05 Thread Arun Vishwanathan
it is difficult to read code and understand but based on the logic u mentioned in 3 points i just want to know if u also have taken care of the case where u have zero points in the array and as u say find each product around 0 points, do u check within each subarray around the zero point if the num

Re: [algogeeks] Amazon Question

2011-08-05 Thread Arun Vishwanathan
by the way doesnt it look like an O(n^2) algo? On Fri, Aug 5, 2011 at 10:53 AM, Arun Vishwanathan wrote: > > would u mind giving a short explanation of yr code too if possible? > > > On Thu, Aug 4, 2011 at 5:38 PM, Apoorve Mohan wrote: > >> I think this should work.

Re: [algogeeks] Amazon Question

2011-08-05 Thread Arun Vishwanathan
would u mind giving a short explanation of yr code too if possible? On Thu, Aug 4, 2011 at 5:38 PM, Apoorve Mohan wrote: > I think this should worktell me if this works... > > void longest_0_1_substring(char *str) > { > int size=0,count=0,max=0,pos=0,prev=0,prev_pos=0,ptr=0,i=0,j=0; > >

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Arun Vishwanathan
there are 12 black and 12 white socks p(bb)+p(ww) is what we want... p(bb)=12/24*11/23 p(ww)=12/24*11/23 so it is just 2*12/24*11/23=11/23 On Wed, Aug 3, 2011 at 9:08 PM, Prakash D wrote: > no.. it's really easy to find it out > > there are 12 black and 12 white pieces. > > let black =1 a

Re: [algogeeks] Re: data type size problem

2011-08-03 Thread Arun Vishwanathan
roll over of valuei has an upper limit On Wed, Aug 3, 2011 at 3:39 PM, Rajesh Kumar wrote: > how i gets value 1 3 5 7..even it is initialized by 4294967295. > > > On Wed, Aug 3, 2011 at 6:36 PM, ManishMCS wrote: > >> It is going to infinite because 4294967295 is not equal to 0, so you >>

Re: [algogeeks] aptitude

2011-08-03 Thread Arun Vishwanathan
in general, if u guys get any answer, please post a short explanation even if it the solution is very obvious to u...not everyone gets it when looking at the answer... On Wed, Aug 3, 2011 at 3:34 PM, wrote: > 45 km/hr > > VM > NSIT, COE, 3rd year > > > On , Kamakshii Aggarwal wrote: > > A car i

Re: [algogeeks] Re: C question.. increment decrement operator..

2011-08-03 Thread Arun Vishwanathan
@amit:+1 On Wed, Aug 3, 2011 at 3:14 PM, amit karmakar wrote: > You are wrong. > The above program invokes undefined behavior. Read the standard > language draft to know about sequence points, side effects and > undefined behavior. > > Between a previous and next sequence point a variable's value

Re: [algogeeks] Amazon Question

2011-08-03 Thread Arun Vishwanathan
it cud also be 0011 On Wed, Aug 3, 2011 at 6:54 AM, payel roy wrote: > It is contiguous ...the answer will be 0110. > > > On 2 August 2011 20:59, ankit sambyal wrote: > >> @payel : Is it sub-sequence or sub-array ?? A sub-sequence may not be >> continuous but a sub-array must be continuous. eg

Re: [algogeeks] what wil be o/p

2011-08-03 Thread Arun Vishwanathan
*chunk On Wed, Aug 3, 2011 at 11:40 AM, Arun Vishwanathan wrote: > hmm i get it..thanks sandeep and thavasi... > i guess i was confused cos arr holds address of first element of array so > it forced me to think along lines of a pointer only... > > @sandeep: i guess yes wh

Re: [algogeeks] what wil be o/p

2011-08-03 Thread Arun Vishwanathan
r is address of the array(which is > numerically the same value as the address of the first element) > > And when you say sizeof(&arr), its similar to sizeof(--some address--) all > addresses/pointers have same size irrespective of type to which the pointer > points. > > &

Re: [algogeeks] Re: Sort IT

2011-08-03 Thread Arun Vishwanathan
yes dave it wud be better if u cud post an explanation of what u r doing in each step..thanks On Wed, Aug 3, 2011 at 6:51 AM, payel roy wrote: > @Dave, > Can you please explain the algo? It's getting very difficult to understand > the code .. > > > On 3 August 2011 01:14, Dave wrote: > >> @Pank

Re: [algogeeks] what wil be o/p

2011-08-03 Thread Arun Vishwanathan
hi i have a slight confusion..i got the above explanation but i have a doubt as in when u say int arr[5], arr is also the pointer to the first element of the array right?..so size(arr) shudnt be the size of pointer (which is int 4 byte address it holds of the first array element?) ..is it not inter

Re: [algogeeks] Odd one out

2011-08-02 Thread Arun Vishwanathan
@gopi can u explain yr tree creation ? I mean u insert the element in the tree if u see it first, then u remove it from the tree if it has already been inserted?( which also means u need to find the element in the tree ?) so if an element is repeated 3 times and another 2 times what is the logic u

Re: [algogeeks] Re: Long string and the first non-repeating character

2011-08-02 Thread Arun Vishwanathan
so can someone please tell me the O(1) space and O(n) time solution to this? @saurabh :can u explain yr logic?is it an O(1) space solution since u have used a 26 element vector? On Tue, Jul 19, 2011 at 4:50 AM, saurabh singh wrote: > 0(n) time o(1) spcae(Dont be too harsh please I am just usin

Re: [algogeeks] Re: plz give some efficient method to find out if a point lies inside or outside the triangle?

2011-07-29 Thread Arun Vishwanathan
@don: is what I have mentioned above almost the same as the method u r saying? On Fri, Jul 29, 2011 at 9:16 PM, Don wrote: > You just need some comparison which determines if they are very close > to equal. You can't expect them to be exactly equal in all 64 bits. > Something like this should be

Re: [algogeeks] self referential struct. Contd.

2011-07-29 Thread Arun Vishwanathan
@puneet : no , in this case since 4 bytes will be used for int a and int c and then 1 byte for char b with 3 padded bytes next..it wud be the same here On Fri, Jul 29, 2011 at 12:11 PM, Puneet Gautam wrote: > @nikhil: If i declare "Char b" after "int c".., would there be any > difference...? > >

Re: [algogeeks] Programming Puzzle!!!!!!!

2011-07-29 Thread Arun Vishwanathan
I can tell u the logic if the minimum existing coin denomination is 1 cent for instance.If the minimum denomination is not 1 u might need to modify the algorithm I guess let v1,v2.vn be the values of the coin denominations u have in the array dynamic programming solution would be as follows:

Re: [algogeeks] Re: permutation of string with repeated characters...

2011-07-28 Thread Arun Vishwanathan
@amit:i am not clear about the code.Maybe could you take your example string aabc and explain a few steps that happen from your code??.The array mk is locally created for each function call and so I do not get how it keeps track of elements tried cos each time it is a new array. On Fri, Jul 29, 20

Re: [algogeeks] plz give some efficient method to find out if a point lies inside or outside the triangle?

2011-07-28 Thread Arun Vishwanathan
a triangle is formed by intersection of 3 linesif u know the equation of those lines check the point and see if it satisfies the inequality equation of the 3 lines to be inside the common region enclosed by the 3 lines... On Thu, Jul 28, 2011 at 8:47 PM, tech rascal wrote: > > -- > You recei

Re: [algogeeks] hai...........

2011-07-28 Thread Arun Vishwanathan
when u log in with a user name and password, the mail client(gmail)(mail server) contacts the IMAP server through a port(imap is 143 i guess)and you can view your mails on the server(the mails that were sent to u sit in a queue on this server) itself or bring a copy to your local machine.SMTP serve

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-25 Thread Arun Vishwanathan
and than + to ++x.. its only cox all the variables are same >> x which will get evaluated finally as 6 before final addition. >> >> >> Please feel free to comment on my understanding.. ;) >> >> Prem >> >> >> On Mon, Jul 25, 2011 at 3:50 PM,

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-25 Thread Arun Vishwanathan
guess why ? > > > On Mon, Jul 25, 2011 at 2:27 PM, Arun Vishwanathan > wrote: > >> thanks sagar! >> so just to confirm ,what i get from above is that the x value before the >> first addition is first updated from 3 to 5( due to 2 pre increments) and >> then

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-25 Thread Arun Vishwanathan
then > y= 5+5 + ++x; > now > y=10+ 6 > y=16; > > hope u now get it :) > > > On Sun, Jul 24, 2011 at 2:30 PM, Arun Vishwanathan > wrote: > >> *x= 3 initially >> >> >> On Sun, Jul 24, 2011 at 11:00 AM, Arun Vishwanathan < >> aaron

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-24 Thread Arun Vishwanathan
*x= 3 initially On Sun, Jul 24, 2011 at 11:00 AM, Arun Vishwanathan wrote: > if that is the case as u say, then wont it be 3+ 4+ 5 when x +3 > initially?..and then x increments by one later due to the single post > increment > > > On Sun, Jul 24, 2011 at 10:15 AM, sagar paree

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-24 Thread Arun Vishwanathan
if that is the case as u say, then wont it be 3+ 4+ 5 when x +3 initially?..and then x increments by one later due to the single post increment On Sun, Jul 24, 2011 at 10:15 AM, sagar pareek wrote: > nope compiler read it from left to right > > > On Sun, Jul 24, 2011 at 12

Re: [algogeeks] Re: doubt in evaluating in expression

2011-07-23 Thread Arun Vishwanathan
@sagar: if what u said previously holds as in when u say y=x++ + ++x is evaluated as 4+4 since ++x results in 4 and 4 is used in x++ too (cos post increment increments x later) then for y=x++ + ++x + ++x with x beginning as 3 shud the expression not be evaluated as 5+5+4( from rhs ++x does a 3 to 4

Re: [algogeeks] image processing

2011-06-27 Thread Arun Vishwanathan
images > > > On Sun, Jun 26, 2011 at 6:23 PM, Arun Vishwanathan > wrote: > >> hmm for starting this , we need 2 shots of a scene right? I have only a >> single image..no stereo vision here >> >> >> On Sun, Jun 26, 2011 at 2:16 PM, sukhmeet singh >&g

Re: [algogeeks] image processing

2011-06-26 Thread Arun Vishwanathan
hmm for starting this , we need 2 shots of a scene right? I have only a single image..no stereo vision here On Sun, Jun 26, 2011 at 2:16 PM, sukhmeet singh wrote: > I don't know how far u have been able to conquer the problem .. We tried > this and used epipolar geometry and 7point algo and found

Re: [algogeeks] image processing

2011-06-22 Thread Arun Vishwanathan
Thanks DK! I have a kinda small doubt.Generally when u say a transformation is of the form y=Ax and in this case A is the tranformation matrix it implies a linear transformation right ? we express even as such for perspective right? but perspective transformations are not linear right? I am sorry

Re: [algogeeks] image processing

2011-06-21 Thread Arun Vishwanathan
thanks DK... what if its a perspective transformation and not affine exactly? cos i tried using this matrix [xnew ynew 1]=[a b c;d e f;0 0 1][x y 1] now after getting the matrix parameters using the feature points matched in both the images , when i put the border pixels as input to this matrix th

[algogeeks] image processing

2011-06-20 Thread Arun Vishwanathan
hi guys, I need some helpgiven 2 images and the matching feature points in the 2 images( maybe some false matches but rare), how can I get the transformation matrix from this so that any other point in source image can be almost correctly translated to a point in destination image?? does anybo

[algogeeks] siemen star

2011-05-16 Thread Arun Vishwanathan
hi all, Does anyone have an algorithm to detect siemens star(s) in an image?? -- 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 alg

<    1   2