Re: [algogeeks] stack. Mid element in o(1)

2013-05-27 Thread Nikhil Agarwal
an email to algogeeks+unsubscr...@googlegroups.com. -- Thanks Regards Nikhil Agarwal B.Tech. in Computer Science Engineering National Institute Of Technology, Durgapur,India http://tech-nikk.blogspot.com -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Highest reminder

2013-05-27 Thread Nikhil Kumar
Since we need to divide so the quotient should be at least 1, and we need greatest remainder, so we need the least no. which will give the quotient 1 upon dividing and that would be the no. you described. Also you would have noted the greatest remainder would be floor(n/2)-1 . On Thursday, 16

Re: [algogeeks] Number of paths

2013-02-21 Thread Nikhil Karnwal
No. of paths =(n+m-2)C(n-1) Total number of times u have to change the column is m-1 and row is n-1 thus u have total (n-1+m-1) operations to do and out of these operations u have to choose n-1 operation for changing rows. ok. On Thu, Feb 21, 2013 at 2:29 PM, Karthikeyan V.B

[algogeeks] Crypt arithmetic!! Needed help in solving..

2013-02-01 Thread nikhil rao
Pls help needed in solving the below problem.. 1 )MULTIPLICATION TYPE A B C * D E C F G H I A C * A C A E * * A F A E C H 2. P X B * W Y A O A Z O O N X W * O X N P * * - O X N Z N

Re: [algogeeks] Puzzle.. How to solve??

2013-01-30 Thread nikhil rao
- 7,10,11,12,14 U - 1,5,13,15 Now, all the questions can be answered. Hope I'm cleared. Thanks Regards, Varun On Tue, Jan 29, 2013 at 12:25 AM, nikhil rao nikhi...@gmail.comjavascript: wrote: Dream teams are formed by television viewers by selecting five players from the sixteen players

Re: [algogeeks] Puzzle.. How to solve??

2013-01-30 Thread nikhil rao
Ya your rite Anmol . 4th was wrong i guess.. incomplete question. On Tuesday, 29 January 2013 12:58:07 UTC+5:30, Anmol Dhar wrote: Answer: 1)- (4) 2)-- (2) 3)--- (a) 4) doubt, for which team match fees you are asking? 5) (b) Correct me if i'm wrong..please

Re: [algogeeks] Re: DP equation for interval problem

2013-01-29 Thread Nikhil Karnwal
28, 2013 at 12:54 AM, Nikhil Karnwal sunnyk12...@gmail.comwrote: Actually dp[i] represent the state in which u make a slice at appearing time of i th fruits.and match represent the overlapping fruits with i. so for each i dp[i]=max(dp[i],dp[j]+match); for all j=[0,i] and match =overlapped

[algogeeks] Puzzle.. How to solve??

2013-01-28 Thread nikhil rao
Dream teams are formed by television viewers by selecting five players from the sixteen players namely F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15 and F16.The players belong to exactly one of the three teams namely Chelsea,Liverpool and United.Every Dream Team must have two players each

Re: [algogeeks] Re: DP equation for interval problem

2013-01-27 Thread Nikhil Karnwal
Actually dp[i] represent the state in which u make a slice at appearing time of i th fruits.and match represent the overlapping fruits with i. so for each i dp[i]=max(dp[i],dp[j]+match); for all j=[0,i] and match =overlapped fruits with i which are not sliced until the cut of j. Hope this will

Re: [algogeeks] Re: Amazon Dynamic Programming problem

2013-01-16 Thread Nikhil Karnwal
This is a impartial game similar to *Take Away Game* that can be solved using game theory. solution of *lucifier* is correct. On Wed, Jan 16, 2013 at 1:57 AM, Don dondod...@gmail.com wrote: Sprague–Grundy theorem On Jan 12, 6:28 pm, Nguyễn Thành Danh danhnguyen0...@gmail.com wrote: Can you

Re: [algogeeks] Re: Minimum sum of Array

2013-01-07 Thread Nikhil Karnwal
@ Don but ur's solution complexity is O(S*N) which is large in case of large N and large numbers. Like in case of s=100 and N=10^5. Correct me if I am wrong. Nikhil Karnwal On Mon, Jan 7, 2013 at 9:04 PM, Don dondod...@gmail.com wrote: Note that you don't need to store the entire P matrix

Re: [algogeeks] Re: Interview Question based on histogram

2012-05-20 Thread Nikhil Agarwal
bars is 1 and bar i has height H[i], 0=iN, zero width and unit depth, and the base plane is at zero. Water is held in the pockets between bars. Then the pocket between H[i] and H[i+1] holds min(H[i],H[i+1]). To get the total, just sum these for 0 = i N-1 . On May 17, 1:57 am, Nikhil Agarwal

Re: [algogeeks] new social network (be the owner of the website)

2012-05-14 Thread Nikhil Mishra
Definitely a spam ! :-) . Add + 1... On Mon, May 14, 2012 at 8:39 AM, abhi mehrotra abhishekmehrotra.i...@gmail.com wrote: nope its real social network!! On Sun, May 13, 2012 at 11:14 PM, Rahul raikra...@gmail.com wrote: spam On 5/13/12, abhi mehrotra abhishekmehrotra.i...@gmail.com

Re: [algogeeks] new social network (be the owner of the website)

2012-05-14 Thread Nikhil Mishra
Company ain't listed yet. Even it gets, think about Offshore funds :-) -Nikhil On Mon, May 14, 2012 at 7:20 PM, abhi mehrotra abhishekmehrotra.i...@gmail.com wrote: Not at all a spam dude just try googling zurker and read about it. regards Abhishek On Mon, May 14, 2012 at 7:04 PM

[algogeeks] Array Summation

2011-11-10 Thread Nikhil Kumar
--- Can you give me the algorithm to add using the above c array in the way desired in multiplication ( be careful about the way numbers are stored) -- Thank You and Regards, Nikhil Kumar +91-9916343619 Product Engineer Commonfloor.com -- You received this message because you are subscribed

Re: [algogeeks] plzzzzzzzz heeeppppp!!!!!!!!!!1

2011-09-15 Thread Nikhil Kumar
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Kumar , Software Engineer @ Ciena Gurgaon. B.E.( Information Technology ) , NSIT Delhi , 2007-2011 -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] plzzzzzzzz heeeppppp!!!!!!!!!!1

2011-09-15 Thread Nikhil Kumar
=en. -- Nikhil Kumar , Software Engineer @ Ciena Gurgaon. B.E.( Information Technology ) , NSIT Delhi , 2007-2011 -- 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

Re: [algogeeks] Pgm

2011-09-11 Thread Nikhil Gupta
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received

Re: [algogeeks] printf

2011-09-03 Thread Nikhil Gupta
@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India

Re: [algogeeks] Re: SAP!!

2011-08-31 Thread Nikhil Gupta
. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT

[algogeeks] Pointer

2011-08-30 Thread Nikhil Gupta
I read a question : To swap two given strings using pointers. Are we supposed to declare two pointers and exchange their values, or use these pointers to swap each element of the two strings one by one? -- Nikhil Gupta NSIT, New Delhi, India -- You received this message because you

[algogeeks] Some bit manipulation help

2011-08-28 Thread Nikhil Gupta
* x; } Can anyone explain how this is working? -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

[algogeeks] Fwd: vertical sum

2011-08-24 Thread Nikhil Veliath
-- Forwarded message -- From: Nikhil Veliath nve...@gmail.com Date: 24 Aug 2011 21:18 Subject: vertical sum To: algogeeks@googlegroups.com algogeeks@googlegroups.com find the vertical sum of a binary tree . . . wat do we mean by vertical sum anyone any help -- You received

[algogeeks] Fwd: vertical sum

2011-08-24 Thread Nikhil Veliath
find vertical sum of a binary tree . . . wat do we mean by vertical sum -- Forwarded message -- From: Nikhil Veliath nve...@gmail.com Date: 24 Aug 2011 21:18 Subject: vertical sum To: algogeeks@googlegroups.com algogeeks@googlegroups.com find the vertical sum of a binary tree

Re: [algogeeks] Re: Multiprocessor scheduling

2011-08-24 Thread Nikhil Gupta
to test for the hard ones. On Wed, Aug 24, 2011 at 7:30 AM, saurabh singh saurab...@gmail.comwrote: @Nikhil Gupta I tried on this strategy but I still could find better solutions. Another approach that I tried was : summing all the jobs. Then finding the total time per processor

Re: [algogeeks] Re: map problem

2011-08-24 Thread Nikhil Kumar
Post your pair functions ..I'm sure you're wrong there! -- 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] dhcp

2011-08-23 Thread Nikhil Veliath
any links or sources how to implement a dhcp server. . . . .using daemon -- 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] Fwd: dhcp

2011-08-23 Thread Nikhil Veliath
-- Forwarded message -- From: Nikhil Veliath nve...@gmail.com Date: Tue, Aug 23, 2011 at 2:15 PM Subject: dhcp To: algogeeks@googlegroups.com any links or sources how to implement a dhcp server. . . . .using daemon -- You received this message because you are subscribed

Re: [algogeeks] Apti

2011-08-23 Thread Nikhil Gupta
The answer can be given by writing all the prime factors as: N = 24 * 33 = 2^3 * 3*2 * 11 = answer will be : (3+1)*(2+1)*(1+1) = 24 This is the answer considering (a,b) and (b,a) different If you consider them same the answer is 24/2 = 12. Nikhil Gupta IIT Roorkee -- You received

Re: [algogeeks] Multiprocessor scheduling

2011-08-23 Thread Nikhil Gupta
this is done something like this: Keep all the processors in a line and keep checking if any processor is idle. If it is , then assign him the job according to shortest job first algo or longest job first.If it has a job then move to the next processor. -- Nikhil Gupta Indian Institute

Re: [algogeeks] Apti

2011-08-23 Thread Nikhil Gupta
sorry I wrote them in different order: if (a,b) and (b,a) are considered same then answer is 12 and if they are considered different it is 24. -- Nikhil Gupta Indian Institute of Technology Roorkee, Roorkee, Uttarakhand, India , 247667 Phone: +91 9634990161 email: nikgp...@iitr.ernet.in

[algogeeks] ds apti

2011-08-22 Thread Nikhil Veliath
need link for ds aptitude ! ! thanks for ur help -- 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] Doubt

2011-08-21 Thread Nikhil Gupta
http://www.ideone.com/kRaMj I found this in the algogeeks forum only. Can anyone explain how value of i is still 0, but *p shows 2 although their addresses are the same. -- Nikhil Gupta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] amazon q

2011-08-21 Thread Nikhil Gupta
. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT

Re: [algogeeks] Re: Directi

2011-08-19 Thread NIKHIL JAIN
some more questions apart from them 1. area of the largest square such that it lies only on the black square of chess such that the side of the chess square is 2 cm. 2. there is a rectangle area such that in it m number of roads are moving from east to west and n number of roads are moving from

Fwd: Re: [algogeeks] Re: array question

2011-08-15 Thread Nikhil Veliath
Dave tu mahan hai . . . . -- Forwarded message -- From: Dipankar Patro dip10c...@gmail.com Date: 14 Aug 2011 23:27 Subject: Re: [algogeeks] Re: array question To: algogeeks@googlegroups.com @Dave nice algo. Really like it. So the whole complexity depends on the sorting. On 14

Re: [algogeeks] array question

2011-08-14 Thread Nikhil Veliath
i feel binary search idea is the best guys i am having problem in finding out complexity...here is my solution to the above problem...whats the complexity... sort the 2 arraysa and b l=0,i=0,flag=0; while(a[i]b[0]) // to start comparing from the value that is slightly greater than the

Re: [algogeeks] an array question

2011-08-13 Thread Nikhil Veliath
@$ did not understand how the original array is sorted to give the number! On Sat, Aug 13, 2011 at 12:50 PM, *$* gopi.komand...@gmail.com wrote: 1.scan the array and find the maximum digits of integer. lets say m.. 2.Again scan the array and pad the intergers whose digits are less that m ( m)

Re: [algogeeks] an array question

2011-08-13 Thread Nikhil Veliath
@$ the ans should be 9823191 and not 98231910 On Sat, Aug 13, 2011 at 12:59 PM, Nikhil Veliath nve...@gmail.com wrote: @$ did not understand how the original array is sorted to give the number! On Sat, Aug 13, 2011 at 12:50 PM, *$* gopi.komand...@gmail.com wrote: 1.scan the array and find

Re: [algogeeks] Re: directi prepration

2011-08-09 Thread NIKHIL JAIN
can any dce student give an idea whats the procedure and what are the questions asked by directi recruitment group -- 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

Re: [algogeeks] Re: directi prepration

2011-08-09 Thread NIKHIL JAIN
thnx can you please tell some of the written questions so that i will have an idea what kind of questions are being asked by them -- 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.

[algogeeks] pls help

2011-08-09 Thread NIKHIL
In a ternary Tree No of leaves 28. How many nodes it have? An AVL tree with height d. How many children it have? -- 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

[algogeeks] Fwd: max product

2011-08-07 Thread Nikhil Veliath
-- Forwarded message -- From: Nikhil Veliath nve...@gmail.com Date: 7 Aug 2011 18:31 Subject: max product To: algoge...@goooglegroups.com given an array that has n nos . . . . find the maximum product of 3 nos and display the 3 nos . . . 25 9 6 8 -20 -5 -10 so max product 5000

[algogeeks] max product!

2011-08-07 Thread Nikhil Veliath
given an array that has n nos . . . . find the maximum product of 3 nos and display the 3 nos . . . 25 9 6 8 -20 -5 -10 so max product 5000 the nos are -20 -10 25 give an O(n) solution and if possible try avoid using sort -- You received this message because you are subscribed to the Google

[algogeeks] Recursion Help

2011-08-07 Thread Nikhil Veliath
i am having problems in writing code using recursion.any help !!...any links? -- 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

Re: [algogeeks] Fwd: max product

2011-08-07 Thread Nikhil Veliath
@puneet: Any code ? Finding the min 3 and max 3 nos witout using sort...so using 6 variables? On Sun, Aug 7, 2011 at 6:41 PM, Puneet Ginoria punnu.gino...@gmail.com wrote: find the first three largest nos. and 3 smallest number(negatives).. then easily you can fig. out the solution.. O(6n)

Re: [algogeeks] Re: c-aps

2011-08-07 Thread Nikhil Veliath
http://cquestionbank.blogspot.com/2008/02/c-pointer-questions-with-solutions.html On Sun, Aug 7, 2011 at 7:10 PM, soundar soundha...@gmail.com wrote: try indiabix.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] recursion help!!!

2011-08-07 Thread Nikhil Veliath
i am having problems in writing code using recursion.any help !!...any links? -- 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] recursion nearest square

2011-08-07 Thread Nikhil Veliath
write a recursive code to print the nearest square of a number eg if no is 27 the nearest square is 5 it should also take care of large nos... -- 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] recursion help!!!

2011-08-07 Thread Nikhil Veliath
will automatically appreciate the power of recursion and learn it :) On Sun, Aug 7, 2011 at 8:03 PM, Nikhil Veliath nve...@gmail.com wrote: i am having problems in writing code using recursion.any help !!...any links? -- You received this message because you are subscribed to the Google

[algogeeks] Fwd: recursive nearest square

2011-08-07 Thread Nikhil Veliath
-- Forwarded message -- From: Nikhil Veliath nve...@gmail.com Date: 7 Aug 2011 20:11 Subject: recursive nearest square To: algogeeks@googlegroups.com write a recursive code to print the nearest square of a number eg if no is 27 the nearest square is 5 it should also

Re: [algogeeks] Re: adobe

2011-08-06 Thread Nikhil Gupta
. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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

Re: [algogeeks] GS on campus

2011-08-06 Thread NIKHIL JAIN
which college -- 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. For more options, visit this

Re: [algogeeks] Question

2011-08-05 Thread Nikhil Gupta
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India

Re: [algogeeks] Question

2011-08-05 Thread Nikhil Gupta
@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You

[algogeeks] To reverse a linked list

2011-08-05 Thread Nikhil Gupta
); list-next=head; print(head2); del(head2); return 0; } -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Re: To reverse a linked list

2011-08-05 Thread Nikhil Gupta
Sorry. this program reverses the 1st k nodes of the linked list. Not the entire list. On Sat, Aug 6, 2011 at 12:48 AM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: What is the error in the program? I tried to run it on ideone, but its giving runtime error. This is a program to reverse

Re: [algogeeks] Puzzle

2011-08-04 Thread Nikhil Gupta
@priyanka, the ropes have a non uniform rate of burning. Means at some duration they will be burning faster, and slower at some. So you cannot say that first rope will take 30mins to burn completely, and by that time second rope is half burnt. Nikhil Gupta -- You received this message

[algogeeks] Puzzle

2011-08-04 Thread Nikhil Gupta
of T.I.M.E.) -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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

Re: [algogeeks] amazon

2011-08-04 Thread Nikhil Gupta
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received

Re: [algogeeks] Puzzle

2011-08-04 Thread Nikhil Gupta
Explain please. On Fri, Aug 5, 2011 at 12:01 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: @sagar:please explain.. On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek sagarpar...@gmail.comwrote: 87.5 % On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote

Re: [algogeeks] amazon

2011-08-04 Thread Nikhil Gupta
the program? On Thu, Aug 4, 2011 at 10:45 PM, arvind kumar arvindk...@gmail.comwrote: First round is online test On Thu, Aug 4, 2011 at 10:43 PM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Is there an online test too? On Thu, Aug 4, 2011 at 10:25 PM, arvind kumar arvindk

Re: [algogeeks] Amazon Aptitude questions

2011-08-03 Thread NIKHIL JAIN
are they what they have asked recently and they consider c/c++ as a part of apti or have a pure c/c++ paper and apti paper -- 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

Re: [algogeeks] c output

2011-08-01 Thread Nikhil Gupta
at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] 32 bit?

2011-07-31 Thread Nikhil Gupta
One more query. What if the architecture is 64 bit, but the OS is 32 bit? (Example windows XP) What will be the size of a pointer variable then? On Sat, Jul 30, 2011 at 8:00 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: @Aditi, Isn't the size of int variable 4 bytes in both

Re: [algogeeks] 32 bit?

2011-07-31 Thread Nikhil Gupta
rajeevr...@gmail.comwrote: If pointer size is 4bytes then it is 32 bit machine and if 8 bytes it is 64 bit On Sat, Jul 30, 2011 at 11:51 AM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: How do you find out if a machine is 32 bit or 64 bit? I was thinking since the size of pointer

Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Nikhil Gupta
In the problem statement, the rabbits give birth to new ones after every 2 months. Not after each month. On Sun, Jul 31, 2011 at 12:51 PM, Tushar Bindal tushicom...@gmail.comwrote: @Nikhil Once the rabbits are mature, they should be able to produce babies every month. after 2 months a female

Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Nikhil Gupta
group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI

Re: [algogeeks] Re: C doubt

2011-07-31 Thread Nikhil Gupta
. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT

[algogeeks] Any help on bits?

2011-07-31 Thread Nikhil Gupta
Given two integers A B. Determine how many bits required to convert A to B. Write a function int BitSwapReqd(int A, int B); -- Nikhil Gupta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Any help on bits?

2011-07-31 Thread Nikhil Gupta
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students

[algogeeks] Pointer

2011-07-31 Thread Nikhil Gupta
How to swap two pointers without using a temporary pointer ? -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Pointer

2011-07-31 Thread Nikhil Gupta
;* *printf(after%d%d,*a,*b);* *return 0;* *}* * * *This swaps pointers * On Sun, Jul 31, 2011 at 7:15 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: How to swap two pointers without using a temporary pointer ? -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students

Re: [algogeeks] Pointer

2011-07-31 Thread Nikhil Gupta
http://ideone.com/YHxVe @Rajeev, check this. On Sun, Jul 31, 2011 at 7:28 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Whats the logic behind **a^=*b;* **b^=*a;* **a^=*b;* ?? On Sun, Jul 31, 2011 at 7:19 PM, rajeev bharshetty rajeevr...@gmail.comwrote: *#includestdio.h* *int

[algogeeks] 32 bit?

2011-07-30 Thread Nikhil Gupta
How do you find out if a machine is 32 bit or 64 bit? I was thinking since the size of pointer variable is different in the 2 configurations, we can declare a pointer and use sizeof() Will that work? Any other suggestions? -- Nikhil Gupta -- You received this message because you

Re: [algogeeks] Write C code to check if an integer is a power of 2 or not in a single line?

2011-07-30 Thread Nikhil Gupta
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received

Re: [algogeeks] Doubt

2011-07-30 Thread Nikhil Gupta
Thanks. Is there any way to implement 2's compliment on binary numbers? On Fri, Jul 29, 2011 at 7:13 PM, rajeev bharshetty rajeevr...@gmail.comwrote: ~ does bitwise not on the operand . It simply inverts all the bits . On Fri, Jul 29, 2011 at 7:09 PM, Nikhil Gupta nikhilgupta2

Re: [algogeeks] Re: self referential struct. Contd.

2011-07-30 Thread Nikhil Gupta
puneet.nsi...@gmail.comwrote: @nikhil: If i declare Char b after int c.., would there be any difference...? On 7/28/11, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Here's another example. struct example { int a; char b; int c; } Now

Re: [algogeeks] Recursive version of reversing linked list

2011-07-30 Thread Nikhil Gupta
, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you

Re: [algogeeks] Re: self referential struct. Contd.

2011-07-30 Thread Nikhil Gupta
not on i386. There are CPU's that can only handle double precision floats if they are aligned on addresses that are a multiople of 8. On Sat, Jul 30, 2011 at 8:23 PM, tech rascal techrascal...@gmail.comwrote: @ Nikhil: please explain y these memory spaces r left empty??? or hw structure padding

Re: [algogeeks] Re: Novell - Puzzle

2011-07-30 Thread Nikhil Gupta
from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because

Re: [algogeeks] Re: Novell - Puzzle

2011-07-30 Thread Nikhil Gupta
And 233 for cows. Shiv narayan's answer is correct. But he didn't add the main cow. On Sat, Jul 30, 2011 at 8:42 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: For rabbits, answer is 256. On Sat, Jul 30, 2011 at 8:33 PM, Tushar Bindal tushicom...@gmail.comwrote: for rabbits answer would

Re: [algogeeks] Re: self referential struct. Contd.

2011-07-30 Thread Nikhil Gupta
30, 2011 at 8:33 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: As explained by someone above : Structure padding is done to try and make sure that variables start in memory at addresses that are a multiple of their size. This is more efficient at hardware level (needs less cpu ticks

Re: [algogeeks] Novell - Puzzle

2011-07-30 Thread Nikhil Gupta
?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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] Novell - Puzzle

2011-07-30 Thread Nikhil Gupta
Pardon. at end of 2nd month 1 pairs added 4th month 2 added 6th month 4 added 8th month 8 added 10th month 16 added 12 th month 32 added and after 12 months, we have a total of 128 pairs. Which means 256 rabbits. On Sun, Jul 31, 2011 at 12:46 AM, Nikhil Gupta nikhilgupta2...@gmail.comwrote

[algogeeks] Doubt

2011-07-29 Thread Nikhil Gupta
What is meant by the statement : byte0 = (num x00FF) 0 And what is meant by the operators , ^ , , | and how are they used? -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed

Re: [algogeeks] Doubt

2011-07-29 Thread Nikhil Gupta
of times( effectively in this case u wont be shifting) On Fri, Jul 29, 2011 at 5:50 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: What is meant by the statement : byte0 = (num x00FF) 0 And what is meant by the operators , ^ , , | and how are they used? -- Nikhil Gupta Senior

Re: [algogeeks] Facebook Intern F2F Interview

2011-07-28 Thread Nikhil Jindal
Generate a random number from 1 to 100. If it is less than or equal to x, return true, else return false. This will ensure that ur returning true with x/100 probability. Cheers Nikhil Jindal On Thu, Jul 28, 2011 at 4:21 PM, KK kunalkapadi...@gmail.com wrote: bool foo(int x) // Implement

Re: [algogeeks] self referential struct. Contd.

2011-07-28 Thread Nikhil Gupta
node will be 12 not 9.., to make it a multiple of 4?? On 7/26/11, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Padding is not a topic of self referential structure. Padding means that extra spaces of memory are used by the compiler to allocate memory. This is done to have the memory

[algogeeks] Permutations in a string

2011-07-27 Thread Nikhil Gupta
Given a string of length 5 (example abcde), write a program to print all the possible combinations OF LENGTH 3. In this case : abc, abd, abe, acd, ace, ade, bcd, bce, bde, cde Can someone provide a working code? -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT

Re: [algogeeks] Re: Permutations in a string

2011-07-27 Thread Nikhil Gupta
...@gmail.com wrote: One more thread is running parallel on the same topic Please refer : http://comments.gmane.org/gmane.comp.programming.algogeeks/17279 On Wed, Jul 27, 2011 at 7:39 AM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Given a string of length 5 (example

Re: [algogeeks]

2011-07-26 Thread Nikhil Gupta
://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] self referential struct. Contd.

2011-07-26 Thread Nikhil Gupta
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India

[algogeeks] Lucky numbers

2011-07-26 Thread Nikhil Gupta
(as they are circularly arranged). This action is done until only one number is left. So given a range of numbers, you have to use an algo to tell which number will be left in the end. Example : 1 2 3 4 5 6 7 8 9 10 11 12 ... 1 3 5 7 9 11 13 15 17 19 . 1 5 9 13 17 21 25 . and so on. -- Nikhil

Re: [algogeeks] C Output

2011-07-25 Thread Nikhil Gupta
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: stacks

2011-07-23 Thread Nikhil Gupta
. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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] Re: C Doubts

2011-07-17 Thread Nikhil Gupta
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. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nikhil Gupta

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread Nikhil Gupta
@Sagar Memory sizes of long double variables are compiler and system configuration dependent. So obviously, in accordance with your compiler, the size of long double is 8 bytes. On Mon, Jul 18, 2011 at 1:22 AM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: @Aditya Here is the padding effect

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread Nikhil Gupta
with the compiler. On Mon, Jul 18, 2011 at 1:27 AM, aditya kumar aditya.kumar130...@gmail.comwrote: @Nikhil why is Address of long double : starts at 11 address locations from char variable ?? is shud start from 3rd adress location from char variable bcoz memory cycle involves a word so are you

Re: [algogeeks] Min Enqueue Dequeue in O(1)

2011-06-07 Thread NIKHIL JAIN
i think sliding window is based on On Tue, Jun 7, 2011 at 9:26 PM, ross jagadish1...@gmail.com wrote: Design a Queue (strictly fifo) to support findmin, enqueue, dequeue in o(1). extra space allowed. (for a stack, its trivial with 2 stacks) Can the same approach be applied for a queue? --

  1   2   3   >