Re: [algogeeks] Digest for algogeeks@googlegroups.com - 1 Message in 1 Topic

2013-09-05 Thread vinay bajaj
subarray_problem >Don > >On Thursday, August 29, 2013 11:09:59 PM UTC-4, yash wrote: > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop r

[algogeeks] Re: m*n matrix, sorted rows, sorted columns, WAP to find an element efficiently

2012-04-02 Thread vinay bajaj
This search can be done easily in O(n+m) start from top right corner. chek out this link you will understand!! http://www.geeksforgeeks.org/archives/11337 On Sunday, 1 April 2012 21:18:26 UTC+5:30, ashgoel wrote: > > -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: water-jug problem

2012-04-02 Thread vinay bajaj
http://www.cut-the-knot.org/wgraph.shtml Every distribution of wine in the three jugs A, B, and C, can be described by the quantities b and c of wine in the jugs B and C, respectively. Thus every possible distribution of wine is described by a pair(b, c). Initially b=c=0 so that one starts wi

[algogeeks] Re: Probability Puzzle

2011-08-08 Thread vinay aggarwal
answer should be 3/5 think like that tossing 5 times will not help you predict the outcome of sixth toss. Therefore that information is meaningless. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeek

Re: [algogeeks] Re: Amazon Interview question

2011-03-01 Thread Vinay Pandey
Hi, Here is my solution, let me know: /* a helper function */ void swap(int* arr, int index1, int index2) { /* this is only to swap to integers */ arr[index1] = arr[index1]^arr[index2]; arr[index2] = arr[index1]^arr[index2]; arr[index1] = arr[index1]^arr[index2]; } /* Actual switching */ void s

Re: [algogeeks] Re: intel puzzle

2011-03-01 Thread Vinay Pandey
each pair of opposite faces can make 4 such triangles, so I think the answer is 12 On Mon, Feb 28, 2011 at 5:47 AM, sourabh jakhar wrote: > the answer would be more than 8 an it is 32 i think. > but i m sure it will be more than 8 > > > On Wed, Feb 23, 2011 at 7:54 AM, Terence wrote: > >> 8C3 -

Re: [algogeeks] Re: Amazon Interview question

2011-03-01 Thread Vinay Pandey
I forgot to mention Time complexity: O(n), Space complexity: O(1) Assuming you accept my solution :-) On Mon, Feb 28, 2011 at 9:27 PM, Vinay Pandey wrote: > Hi, > > Here is my solution, let me know: > > > /* a helper function */ > void swap(int* arr, int index1, int index2

Re: [algogeeks] Re: Antipodal points

2011-02-25 Thread vinay reddy
cases of this algo is N*N , if we try balancing the tree while inserting I guess it can be done in NlogN Thanks Vinay On Fri, Feb 25, 2011 at 9:20 AM, Gene wrote: > Dave's solution is best if numerical error is possible. > > If the points are precise, you can also do it in line

Re: [algogeeks] Amazon Online Test

2011-02-23 Thread vinay reddy
U need to construct a binary tree given only PreOrder traversal with the condition that each node has zero or two children. On Wed, Feb 23, 2011 at 10:52 AM, murthy.krishn...@gmail.com < murthy.krishn...@gmail.com> wrote: > hii vinay, > > can u elaborate the third question > &

Re: [algogeeks] Amazon Online Test

2011-02-22 Thread vinay reddy
, where every node has zero or two children. e.g String = "NNNLLL" , N represents internal Node , L represents leaf Node. The alloted time was 1hr. and asked to write the function only ... no main function and all. hope this helps Thanks vinay On Wed, Feb 16, 2011 at 3:45 PM, Anu

[algogeeks] Re: 10 most repeating words

2010-10-22 Thread Vinay...
can u plz elaborate how min heap helps to find most repeating words On Oct 21, 6:40 am, ashish agarwal wrote: > use a array of 10 and apply min heap > > > > On Thu, Oct 21, 2010 at 7:05 PM, Vinay... wrote: > > how do u find 10 most repeating words on a large file contain

[algogeeks] 10 most repeating words

2010-10-21 Thread Vinay...
how do u find 10 most repeating words on a large file containing words in most efficient way...if it can also be done using heapsort plz post ur answers.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to al

Re: [algogeeks] Re: Will miracle ever print ?

2010-08-29 Thread VINAY KUMAR NAIDU
I think by defining equivalnces also we can print miracle for ex -1%2 and 1%2 are same and 1%2!=0 odd%2 and -odd%2 are same and odd!=0 but -1%2 is giving -1 . but don't know how to make it 1. help someone if possible. On Mon, Aug 30, 2010 at 12:40 AM, srinivas reddy wrote: > @aravind thanks y

[algogeeks] Re: [algogeeks]

2009-02-13 Thread Vinay Pandey
which tree? On Tue, Feb 10, 2009 at 7:01 AM, praba garan wrote: > how to find the successor of an element in a tree ?? > > thank u > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

[algogeeks] Re: subset with maximum sum.

2007-10-16 Thread Vinay Chilakamarri
[1,12,-3,14,-6,3,4,-2] Check if your approach works here. Apparently not. A subset of an array should also be continuous, by definition. On 10/15/07, Muntasir Azam Khan <[EMAIL PROTECTED]> wrote: > > > > > On Oct 13, 11:39 pm, kannan <[EMAIL PROTECTED]> wrote: > > hellow! > > here is the

[algogeeks] Re: Implement division without using divide operator

2007-10-08 Thread Vinay Chilakamarri
in the previous logic, dont forget to address a negative divisor, dividend and alternative cases like those... it shud be pretty easy On 10/8/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote: > > hey there i did play around with bit shifting sometime ago and was able to > do th

[algogeeks] Re: Implement division without using divide operator

2007-10-08 Thread Vinay Chilakamarri
or in the above logic.. Ill post the bit shifting algo soon ~_ On 10/7/07, Ajinkya Kale <[EMAIL PROTECTED]> wrote: > > @Vinay : Can you please explain the algorithm of your code.. > > On 10/7/07, Vinay Chilakamarri < [EMAIL PROTECTED]> wrote: > > > > How about rec

[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Vinay Chilakamarri
Sorry but lets start with a quotient of 1 On 10/7/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote: > > How about recursive way: > > int funcNoDiv(int divisor, int dividend) > { > //base case > if(divisor == dividend) > { > return 1; >

[algogeeks] Re: Implement division without using divide operator

2007-10-07 Thread Vinay Chilakamarri
How about recursive way: int funcNoDiv(int divisor, int dividend) { //base case if(divisor == dividend) { return 1; } else if( divisor > dividend) { return 0; } else // divisor < dividend { while(divisor <= dividend) { divisor = divisor << 1; r

[algogeeks] Re: Algoritm needed

2007-03-28 Thread vinay
Thank You --vinay On Mar 28, 10:13 pm, "Atamurad Hezretkuliyev" <[EMAIL PROTECTED]> wrote: > http://en.wikipedia.org/wiki/Assignment_problemhttp://en.wikipedia.org/wiki/Hungarian_algorithm --~--~-~--~~~---~--~~ You received this mess

[algogeeks] Re: Algoritm needed

2007-03-28 Thread vinay
The example given by Atamurad suits my need.. On Mar 28, 4:09 pm, "vinay" <[EMAIL PROTECTED]> wrote: > Hai all, > Given a N X N Matrix( with +ve integers), How to find the elements, > such that only one element from each row and one element from each > column and su

[algogeeks] Algoritm needed

2007-03-28 Thread vinay
Hai all, Given a N X N Matrix( with +ve integers), How to find the elements, such that only one element from each row and one element from each column and sum of the elements is minimum. Thanks --vinay --~--~-~--~~~---~--~~ You received this message because you