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

2013-09-05 Thread vinay bajaj
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 receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com. -- Vinay

[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

[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: 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

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 babbupan...@gmail.com wrote: Hi, Here is my solution, let me know: /* a helper function */ void swap(int* arr, int index1, int index2

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 sourabhjak...@gmail.comwrote: 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

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

Re: [algogeeks] Re: Antipodal points

2011-02-25 Thread vinay reddy
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 gene.ress...@gmail.com wrote: Dave's solution is best if numerical error is possible. If the points are precise, you can also do it in linear

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 thanks, Krishna

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, Anurag Bhatia abhati

[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 ashish.cooldude...@gmail.com wrote: use a array of 10 and apply min heap On Thu, Oct 21, 2010 at 7:05 PM, Vinay... vinumars...@gmail.com wrote: how do u find 10 most repeating words

[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

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

[algogeeks] Re: [algogeeks]

2009-02-13 Thread Vinay Pandey
which tree? On Tue, Feb 10, 2009 at 7:01 AM, praba garan prabagara...@gmail.com 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

[algogeeks] Re: Implement division without using divide operator

2007-10-08 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;

[algogeeks] Re: Implement division without using divide operator

2007-10-08 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; } else if( divisor dividend) { return 0

[algogeeks] Re: Implement division without using divide operator

2007-10-08 Thread Vinay Chilakamarri
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 recursive way: int funcNoDiv(int divisor, int dividend

[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 that.. but yeah i guess

[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 sum of the elements is minimum. Thanks