Re: [algogeeks] Explain the code

2012-03-20 Thread Amit Kumar
@sajal I mean the same. Warm Regards Amit Kumar Master Of Computer Applications University Of Delhi -- 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

Re: [algogeeks] Samsung SISO Question

2011-08-05 Thread amit kumar
can u plz xplain d qstn a litl more thanx On Fri, Aug 5, 2011 at 8:33 PM, bagaria.ka...@gmail.com bagaria.ka...@gmail.com wrote: Given a rope of 10m , numbered at 1m i.e like 0 1 2 3 4 5 6 7 8 9 10 ||---|---|---|---|---|---|---|---|---| |---10m|

Re: [algogeeks] puzzle

2011-07-06 Thread amit kumar
thanx guys On Wed, Jul 6, 2011 at 2:40 PM, udit sharma sharmaudit...@gmail.com wrote: (5*5)+(!5)/(5+5) and (((5+5)/5)^5)+5 -- Regards UDIT DU- MCA -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Longest substring 0's 1's

2011-07-06 Thread amit kumar
excellent solution sunny On Tue, Jul 5, 2011 at 11:44 PM, amit kumar amitthecoo...@gmail.com wrote: #includestdio.h #define n 11 int main() { int ar[n]={1,0,1,1,1,0,0,0,0,0,1}; int a[n][n]; int l,i,k,maxlength=0,start,end; for(i=0;in;i++) { ar[i]==0?(a[i][i

Re: [algogeeks] find output

2011-07-04 Thread amit kumar
thanx guys... On Mon, Jul 4, 2011 at 5:11 PM, mahesh.jnumc...@gmail.com mahesh.jnumc...@gmail.com wrote: In while loop, the value of i will be used as 0 as it is post decrement so the value of i will decrement after the while loop is executed. so 0!=0 will fail and the value of i will get

Re: [algogeeks] find output

2011-07-03 Thread amit kumar
i think d answer sud be 10. but it comes out to be 5. xplain plz On Mon, Jul 4, 2011 at 10:30 AM, Sandeep Jain sandeep6...@gmail.com wrote: Apoorve, please explain the reason for this output as well Regards, Sandeep Jain On Mon, Jul 4, 2011 at 1:06 AM, Apoorve Mohan

Re: [algogeeks] null macro

2011-06-30 Thread amit kumar
no difference On Thu, Jun 30, 2011 at 11:24 PM, simran ngxprerna2...@gmail.com wrote: null macro is defined as #define NULL (void*)0..is there any difference in null macro definition in c and c++? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] novel written test

2011-06-28 Thread amit kumar
ohh its a straight chain..nt a rounded one.. gt it On Tue, Jun 28, 2011 at 12:42 PM, sagar pareek sagarpar...@gmail.comwrote: @amit Check out your IQ On Tue, Jun 28, 2011 at 2:43 AM, amit kumar amitthecoo...@gmail.comwrote: how 2?? On Tue, Jun 28, 2011 at 2:40 AM, gmagog

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
@piyush..will u xplain plz. by d way 2 sons cant hav d same age(hope they r nt twins) On Tue, Jun 28, 2011 at 2:14 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: 1,6,6 On Tue, Jun 28, 2011 at 2:07 AM, amit the cool amitthecoo...@gmail.comwrote: Conversation between two mathematicians:

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
how 2?? On Tue, Jun 28, 2011 at 2:40 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: if( links can be melt and made into smaller links ) { return 1; } else { return 2; } Yanan Cao On Mon, Jun 27, 2011 at 4:09 PM, sourabh jakhar sourabhjak...@gmail.comwrote: two On

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
have unique age for the youngest son..hence the ages.. and 2 sons can have same age without being twins...one born in the month of jan and the other born in the month of december...:P :P moreover its no where mentioned there can't be any twins On Tue, Jun 28, 2011 at 2:24 AM, amit kumar

Re: [algogeeks] Re: puzzle

2011-06-26 Thread amit kumar
hey harry.what r u upto? guys have already shown that answer is three On Mon, Jun 27, 2011 at 4:45 AM, hary rathor harry.rat...@gmail.com wrote: 5 mice: result time complete bottle to mice1: 14 hour after 2.5

Re: [algogeeks] Re: find output.

2011-06-16 Thread amit kumar
//kk //In place of char *p=hai friends,*p1; if i declare as char p[]=hai friends; char *p1; //then ?? On Thu, Jun 16, 2011 at 8:16 AM, DIPANKAR DUTTA dutta.dipanka...@gmail.comwrote: It's ok.. char *p=hai friends...not correct bcz you did allocate memory for that string but assiging

Re: [algogeeks] Re: find output.

2011-06-16 Thread amit kumar
cp[] = howdy; Since compilers often don’t enforce the difference you won’t be reminded to use this latter form and so the point becomes rather subtle. On Thu, Jun 16, 2011 at 12:59 PM, amit kumar amitthecoo...@gmail.comwrote: //kk //In place of char *p=hai friends,*p1; if i declare

Re: [algogeeks] [brain teaser 15 june ] Engineer Physicist Mathematician puzzle

2011-06-15 Thread amit kumar
@anika jain: will u plz xplain?? On Wed, Jun 15, 2011 at 4:02 PM, Anika Jain anika.jai...@gmail.com wrote: earth is a sphere i.e consisiting of infinite circles.. so mathematician had put the fence around that circle of the sphere where fence's length is equal to the circle's perimeter. On

Re: [algogeeks] Re: is it correct??

2011-06-14 Thread amit kumar
but such a declaration is working correctly in g++ On Tue, Jun 14, 2011 at 8:22 PM, Don dondod...@gmail.com wrote: One line or the other is not correct. The size of an array must be a constant, and you can't read into a const. If you want to do something like this, use malloc: cin x; int

Re: [algogeeks] Re: finding whether sum of two numbers of array is equal to given number or not ? plz tell why my this is not working for x=10,11,13 values

2011-06-12 Thread amit kumar
can it be done in O(nlogn) On Sun, Jun 12, 2011 at 8:42 PM, Ashish Goel ashg...@gmail.com wrote: once the array is sorted, it is very easy have two pointers one on left and one on right take the sum, if sum is greater, move right one inwards else if less than sum, move left one inwards do

Re: [algogeeks] Re: finding whether sum of two numbers of array is equal to given number or not ? plz tell why my this is not working for x=10,11,13 values

2011-06-12 Thread amit kumar
can it be done in O(n) On Sun, Jun 12, 2011 at 11:00 PM, amit kumar amitthecoo...@gmail.comwrote: can it be done in O(nlogn) On Sun, Jun 12, 2011 at 8:42 PM, Ashish Goel ashg...@gmail.com wrote: once the array is sorted, it is very easy have two pointers one on left and one on right take

Re: [algogeeks] [brain teaser ] Famous Probability puzzle SHOOT

2011-06-08 Thread amit kumar
Mr. White On Wed, Jun 8, 2011 at 2:30 PM, nicks crazy.logic.k...@gmail.com wrote: what does the highest chance of survival ? mean.. is it about black's survival or overall survival.i'm confused On Wed, Jun 8, 2011 at 1:33 AM, DeVaNsH gUpTa devanshgupta...@gmail.comwrote: In the

Re: [algogeeks] Re: PUZZLE

2011-05-20 Thread amit kumar
533 On Sat, May 21, 2011 at 2:13 AM, Dave dave_and_da...@juno.com wrote: @Bhavesh: 533-1/3. Dave On May 20, 10:47 am, Bhavesh agrawal agr.bhav...@gmail.com wrote: 1 elephant can take 1000 banana at a time and eat 1 banana after each 1km travel. total bananas are 3000 and distance have

Re: [algogeeks] Array problem

2011-05-18 Thread amit kumar
@kunal patil your soln does not work for 5 3 4 5 3 3 On Tue, May 17, 2011 at 9:57 PM, Kunal Patil kp101...@gmail.com wrote: Ohh..If it is so...Sorry !![?] I understood it the different way...[?] But if the question is as mentioned in your 2nd case then also I believe there is O(n)

Re: [algogeeks] Array problem

2011-05-18 Thread amit kumar
i dnt htink a o(n) soln exists for this problem. On Wed, May 18, 2011 at 3:47 PM, amit kumar amitthecoo...@gmail.com wrote: @kunal patil your soln does not work for 5 3 4 5 3 3 On Tue, May 17, 2011 at 9:57 PM, Kunal Patil kp101...@gmail.com wrote: Ohh..If it is so...Sorry !![?] I

Re: [algogeeks] Re: MATHS TRICK TEASER 9 may

2011-05-14 Thread amit kumar
superb answer by dave On Sun, May 15, 2011 at 8:27 AM, Amol Sharma amolsharm...@gmail.com wrote: like utkarsh answer -- Amol Sharma Second Year Student Computer Science and Engineering MNNIT Allahabad On Wed, May 11, 2011 at 12:58 AM, Dave dave_and_da...@juno.com wrote: 19 = XIX

Re: [algogeeks] manually initialise indexing of an array

2011-03-10 Thread amit kumar
thanx launde. its working. On Thu, Mar 10, 2011 at 4:00 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: may be this will do int arr[21]; int *a; a=arr+10; now a can vary from a[-10] to a[10] I have doubts but will this work ? On Thu, Mar 10, 2011 at 3:31 PM, amit

Re: [algogeeks] brain teaser

2011-03-03 Thread amit kumar
ya at least 10 can be easily freed On Thu, Mar 3, 2011 at 2:18 PM, Manish Pathak pathak@gmail.com wrote: I think that the last person will tell the color of next front person of him, that means next person will sure that his hat color will be color ,telling by back person. thus person 19

Re: [algogeeks] binary matrix

2010-10-04 Thread amit kumar
Hi, http://geeksforgeeks.org/?p=6257 This link contains a very simple and well explained solution for the first part of the question. Thanks Amit On Mon, Oct 4, 2010 at 5:21 PM, mac adobe macatad...@gmail.com wrote: Given a binary matrix, find out the maximum size square sub-matrix with all

Re: [algogeeks] MXN matrix

2010-04-29 Thread amit kumar
Answer for question 1: http://geeksforgeeks.org/?p=6257 And, I think the same solution can be extended/manipulated for rectangular matrix with largest number of 1's. Regards, Amit On Wed, Apr 28, 2010 at 10:23 PM, Vivek S s.vivek.ra...@gmail.com wrote: Let Memo[i][j] be the sum of elements