Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread aseem garg
The soln is nth term of fibonacci sequence...isnt it? Aseem On Sat, Aug 13, 2011 at 9:27 PM, Akash Mukherjee akash...@gmail.com wrote: dp problem, refer to dp from AFI On Sat, Aug 13, 2011 at 9:01 PM, Decipher ankurseth...@gmail.com wrote: There is a river and there are n number of

Re: [algogeeks] Re: Quantz

2011-08-11 Thread aseem garg
@Aditi: Why use powers of 2 when we can use powers of three in case of weights?? Aseem On Fri, Aug 12, 2011 at 1:53 AM, aditi garg aditi.garg.6...@gmail.comwrote: @sagar : :):) On Fri, Aug 12, 2011 at 1:51 AM, sagar pareek sagarpar...@gmail.comwrote: thanks aditi for the explanation

Re: [algogeeks] Re: o/p

2011-08-07 Thread aseem garg
What was the mistake? Aseem On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: i got my mistake...sorry guys On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: what is the problem with the following code void fun(int **p) {

Re: [algogeeks] output help

2011-08-07 Thread aseem garg
typedef doesn't declare an instance of a variable, it declares a type (type alias actually), static is a qualifier you apply to an instance, not a type, so you can use static when you use the type, but not when you define the type. Aseem On Mon, Aug 8, 2011 at 12:29 AM, Kamakshii Aggarwal

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread aseem garg
If the coin is unbiased then probability of heads: 1/2 irrespective of whether it is first time or nth time. So answer should be 3/5. Aseem On Mon, Aug 8, 2011 at 12:39 AM, saurabh chhabra saurabh131...@gmail.comwrote: Even u dont get why u people are gettin 17/80...the probability that it

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread aseem garg
that the tossed coin is a head is 3/5 17/80 is the probability to get head at all the six times. the soln. for this problem will be 3/5 On Mon, Aug 8, 2011 at 12:45 AM, aseem garg ase.as...@gmail.com wrote: If the coin is unbiased then probability of heads: 1/2 irrespective of whether

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread aseem garg
@Shuaib: **What is the probability that you toss *next time, heads turns up ***. Aseem On Mon, Aug 8, 2011 at 1:19 AM, Shuaib Khan aries.shu...@gmail.com wrote: On Mon, Aug 8, 2011 at 12:47 AM, aseem garg ase.as...@gmail.com wrote: Think it like this. I have tossed a coin 5 times

Re: [algogeeks] Puzzle

2011-08-07 Thread aseem garg
Put 0 in the first well and see the magic. :P Aseem On Sun, Aug 7, 2011 at 6:50 PM, mani sharma monadh...@nsitonline.in wrote: the word half was so confusing in the ques!! :( On 5 August 2011 00:24, Himanshu Srivastava himanshusri...@gmail.comwrote: oh ok..thankshalf

Re: [algogeeks] CAMPUS VISIT..

2011-08-03 Thread aseem garg
Which college? Aseem On Thu, Aug 4, 2011 at 12:07 AM, Mohit Goel mohitgoel291...@gmail.comwrote: hey guys does anyone know about WINSHUTTLE...its coming to ur campus... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] Output Help.

2011-07-30 Thread aseem garg
int b=2;b=b++; b=??? Plz explain.. Aseem -- 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.

Re: [algogeeks] Output Help.

2011-07-30 Thread aseem garg
@Kamakshi: Run karke dekh leti pehle. :-/ Aseem On Sun, Jul 31, 2011 at 1:34 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: 3.it is same as b=b+1; On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.com wrote: int b=2;b=b++; b=??? Plz explain.. Aseem -- You received

Re: [algogeeks] Output Help.

2011-07-30 Thread aseem garg
, aseem garg ase.as...@gmail.com wrote: int b=2;b=b++; b=??? Plz explain.. Aseem -- 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

Re: [algogeeks] Output Help.

2011-07-30 Thread aseem garg
at 1:38 AM, aditi garg aditi.garg.6...@gmail.comwrote: it would be undefined... On Sun, Jul 31, 2011 at 1:34 AM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: 3.it is same as b=b+1; On Sun, Jul 31, 2011 at 1:32 AM, aseem garg ase.as...@gmail.com wrote: int b=2;b=b++; b=??? Plz explain

Re: [algogeeks] Output Help.

2011-07-30 Thread aseem garg
On Dev CPP. Aseem On Sun, Jul 31, 2011 at 1:42 AM, aseem garg ase.as...@gmail.com wrote: I am getting 2. . Aseem On Sun, Jul 31, 2011 at 1:41 AM, Neeraj Gupta neeraj.gupta...@gmail.comwrote: Yes, it's UB. For such ques, try to run it on ideone. It will give a warning if any

[algogeeks] Merge unsorted arrays

2011-07-16 Thread aseem garg
Q2. Given m arrays of n size each, give an algorithm to combine these arrays into a single array with sorted elements. Also tell the time complexity of your solution. Aseem -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

Re: [algogeeks] MS:Linked list

2011-07-15 Thread aseem garg
Use a Hash Table. Aseem On Sat, Jul 16, 2011 at 12:28 AM, shady sinv...@gmail.com wrote: i don't think it is possible to do it in O(n)... rather not even in O(nlogn) without modifying the list On Fri, Jul 15, 2011 at 11:23 PM, Nishant Mittal mittal.nishan...@gmail.com wrote: How will

Re: [algogeeks] puzzle

2011-07-06 Thread aseem garg
14 attempts Aseem On Wed, Jul 6, 2011 at 10:44 PM, Tushar Bindal tushicom...@gmail.comwrote: Eggs can never break the building. So dropping the eggs won't break the building - whether you drop them from 1st floor or 100th floor. On Wed, Jul 6, 2011 at 10:42 PM, Sriganesh Krishnan

Re: [algogeeks] puzzle

2011-07-06 Thread aseem garg
Suppose u start from x floor. Two cases arise...the egg breaks or it does not. If it doesthen u have to move linearly from first floor. till x-1 floor..Max attempts reqd. = x If it does not break.take a jump of x-1 because ur number of attempts has already increased by1.

Re: [algogeeks] string matching

2011-06-23 Thread aseem garg
Patrick!!! On Thu, Jun 23, 2011 at 11:29 AM, prateek gupta prateek00...@gmail.comwrote: yup, got it thanks!!! On Thu, Jun 23, 2011 at 11:27 AM, sunny agrawal sunny816.i...@gmail.comwrote: last line is *in worst case k=1 only 2*n comparisons will be there hence O(n)* On Thu, Jun 23,