Re: [algogeeks] expectation values..

2012-06-17 Thread Piyush Kapoor
+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Microsoft Interview Question

2012-06-13 Thread Piyush Kapoor
, 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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received

Re: [algogeeks] Re: problem

2012-06-10 Thread Piyush Kapoor
A correction, it is *(2^p) - 1 *, and the answer (*2^(number of primes less than n)) - 1* .(It is simply taking any subset of the primes,leaving the one in which do not take any prime) On Sun, Jun 10, 2012 at 10:03 PM, Piyush Kapoor pkjee2...@gmail.com wrote: The problem simply asks you

Re: [algogeeks] Array problem

2012-03-12 Thread Piyush Kapoor
: @piyush : i dont think so BIT would work over here , we are not just reporting cumulative sum tilll index i. On Mon, Mar 12, 2012 at 12:58 AM, Piyush Kapoor pkjee2...@gmail.comwrote: This can be done very easily with the help of a Binary Indexed Tree,and it is very short to code as well.Simply

Re: [algogeeks] Array problem

2012-03-12 Thread Piyush Kapoor
1)First map the array numbers into the position in which they would be, if they are sorted,for example {30,50,10,60,77,88} --- {2,3,1,4,5,6} 2)Now for each number ,find the cumulative frequency of index ( = the corresponding number in the map - 1). 3)Output the cumulative frequency and increase

Re: [algogeeks] ORDERS

2012-02-06 Thread Piyush Kapoor
. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread Piyush Kapoor
xy is a mixed expression involving two operands of different types,one of unsigned int and other signed int.Since implicit type conversion takes place in such cases,the signed int is converted to unsigned int ,which means that -2(signed) is converted to 4294967294 (unsigned) .,and then the

Re: [algogeeks] Re : GAMECOIN

2012-01-23 Thread Piyush Kapoor
) == (N-1)C2 4)Using exactly 3 'H's::== (N-2)C3 and so on.. Answer = = 1+NC1 + (N-1)C2 + (N-2)C3 + . (till N-r =r) which is same as fibonacci series. So the answer was the fibonacci number divided by (2^n) -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because

Re: [algogeeks] choosing numbers

2011-10-23 Thread Piyush Kapoor
. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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] Re: rise and fall of power

2011-10-05 Thread Piyush Kapoor
In which library do powl() and log10l() lie(they r not in cmath,i think) ,can anybody post a good reference to these..(I could not find much on googling) -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: rise and fall of power

2011-10-05 Thread Piyush Kapoor
Yes these are in cmath(or math.h) , /* 7.12.6.8 Double in C89 */ extern float __cdecl log10f (float); extern long double __cdecl log10l (long double); -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received

Re: [algogeeks] Re: question

2011-09-22 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor

Re: [algogeeks] Kth largest element

2011-09-08 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE

Re: [algogeeks] ACM

2011-09-08 Thread Piyush Kapoor
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Need algorithm asap

2011-09-02 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received

Re: [algogeeks] Re: SPOJ ACODE

2011-08-27 Thread Piyush Kapoor
,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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

Re: [algogeeks] Re: SPOJ ACODE

2011-08-27 Thread Piyush Kapoor
; } -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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

Re: [algogeeks] An Interesting DP Question

2011-08-25 Thread Piyush Kapoor
solution -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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

Re: [algogeeks] Another DP Question on String Palindrom

2011-08-25 Thread Piyush Kapoor
at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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] Re: spoj coin tossing

2011-08-24 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received

Re: [algogeeks] Strange Billboard of Judge Spoj

2011-08-23 Thread Piyush Kapoor
email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: microsoft paper that i wrote today..

2011-08-13 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message

Re: [algogeeks] String Question

2011-08-13 Thread Piyush Kapoor
. 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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU

Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Piyush Kapoor
/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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

[algogeeks] Problems on Linked List

2011-08-10 Thread Piyush Kapoor
.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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] Problems on Linked List

2011-08-10 Thread Piyush Kapoor
to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one

Re: [algogeeks] Problems on Linked List

2011-08-10 Thread Piyush Kapoor
copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem

Re: [algogeeks] hi

2011-08-09 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you

Re: [algogeeks] A Nice Programming Challenge Question

2011-08-07 Thread Piyush Kapoor
/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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: output???

2011-08-05 Thread Piyush Kapoor
I think it is because the numbers like 0.7 do not have a exact binary representation,so they are not exactly represented in float,while the constant is internally implemented as double.,Read this:: http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=integersReals -- *Regards,* *Piyush Kapoor

Re: [algogeeks] Re: C output

2011-07-28 Thread Piyush Kapoor
. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

Re: [algogeeks] SPOJ

2011-07-23 Thread Piyush Kapoor
. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] Whats wrong?

2011-07-14 Thread Piyush Kapoor
email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] c doubt

2011-07-13 Thread Piyush Kapoor
. 01001100110011001100110011001100110011(non terminationg) but only 1st 23 bits are saved rest are left so finally wht we get is: 1100 10100110 01100110 01100110 (64) (-90) (102)(102) On Wed, Jul 13, 2011 at 2:49 PM, Piyush Kapoor pkjee2...@gmail.comwrote: why do we need

Re: [algogeeks] Re: Minimum/Maximum Sum path in A Binary Tree

2011-07-13 Thread Piyush Kapoor
://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] c doubt

2011-07-13 Thread Piyush Kapoor
why is the order of numbers reversed? On Wed, Jul 13, 2011 at 8:07 PM, Anika Jain anika.jai...@gmail.com wrote: sorry its 0100 not 1100 coz 5.2 is a positive no. so sign bit is 0 On Wed, Jul 13, 2011 at 7:58 PM, Piyush Kapoor pkjee2...@gmail.comwrote: Shouldn't the value

Re: [algogeeks] c doubt

2011-07-13 Thread Piyush Kapoor
.. the order isnt reversed.. look at the code, the code 1st prints lowest order byte then next and then next and then highest soo output is 102 102 -90 64 On Wed, Jul 13, 2011 at 8:08 PM, Piyush Kapoor pkjee2...@gmail.comwrote: why is the order of numbers reversed? On Wed, Jul 13, 2011 at 8:07

Re: [algogeeks] c doubt

2011-07-13 Thread Piyush Kapoor
thanks,i hv just entered 2nd year,so most probably i will study this year -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

Re: [algogeeks] c code bst mirror prob

2011-07-13 Thread Piyush Kapoor
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] c doubt

2011-07-11 Thread Piyush Kapoor
,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Piyush Kapoor
char a[20]; int l; int main() { char str[100]; scanf(%s,str); l=strlen(str); } -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] Reversing the order of words in String

2011-07-07 Thread Piyush Kapoor
Pls Ignore my above post.. On Thu, Jul 7, 2011 at 10:36 PM, Piyush Kapoor pkjee2...@gmail.com wrote: char a[20]; int l; int main() { char str[100]; scanf(%s,str); l=strlen(str); } -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- *Regards,* *Piyush Kapoor,* *CSE

Re: [algogeeks] Reversing the order of words in String

2011-07-07 Thread Piyush Kapoor
at 10:37 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Pls Ignore my above post.. On Thu, Jul 7, 2011 at 10:36 PM, Piyush Kapoor pkjee2...@gmail.comwrote: char a[20]; int l; int main() { char str[100]; scanf(%s,str); l=strlen(str); } -- *Regards,* *Piyush Kapoor

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-05 Thread Piyush Kapoor
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. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you

Re: [algogeeks] Taking Input

2011-07-02 Thread Piyush Kapoor
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] Re: HOW TO IMPLEMENT WITH DP..

2011-07-01 Thread piyush kapoor
. 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. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You

Re: [algogeeks] BST

2011-06-29 Thread piyush kapoor
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. -- *Regards,* *Piyush Kapoor,* *CSE

Re: [algogeeks] Coing tossing(SPOJ)

2011-06-28 Thread piyush kapoor
://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

Re: [algogeeks] Algorithms

2011-06-28 Thread piyush kapoor
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. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU

Re: [algogeeks] Re: Cisco Question

2011-06-27 Thread piyush kapoor
at http://groups.google.com/group/algogeeks?hl=en. -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] Re: Cisco Question

2011-06-27 Thread piyush kapoor
that we have the two sets of bits in the correct positions, we simply need to combine them, and the logical or operator does that just fine. The overall result is (x 0x55) 1) | ((x 1) 0x55). Dave On Jun 27, 7:53 am, piyush kapoor pkjee2...@gmail.com wrote: Yep,I also want to know the same

Re: [algogeeks] Segmentation fault

2011-06-23 Thread piyush kapoor
You are using too much memory :: long long arr[10003][10003]; -- 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] c doubt

2011-06-23 Thread piyush kapoor
int main() { char a; printf(%d %d,sizeof(a),sizeof('a')); return 0; } Output: 1 4 why does the expression sizeof('a') evaluates it as an integer,not as a character?? -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you are subscribed to the Google

Re: [algogeeks] c doubt

2011-06-23 Thread piyush kapoor
You didn't understand my question... Why is sizeof() interpreting a constant character literal as ascii??? -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] c doubt

2011-06-23 Thread piyush kapoor
Thanks a lot :) -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

Re: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-06-23 Thread piyush kapoor
BTW,which book is being referred?? -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] How to remove return 0

2011-06-23 Thread piyush kapoor
exit(0) is one option..( http://cboard.cprogramming.com/c-programming/118998-exit-0-doubt.html) -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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] c query

2011-06-23 Thread piyush kapoor
http://ideone.com/CJxFK give (null) 0.00 -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- 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

[algogeeks] Re: addition without using arithmetic operators

2009-09-30 Thread Piyush Kapoor
consider 2 nos a = 1010 b = 1011 ( in bits) take xor of these c = a ^ b; c = 1010 ^1011; c = 0001 idea is if there are 2 1s then make it 0 , if one 1 and one 0 then make it 1; d = ab; when there are 2 ones u have to produce a carry . d = 1010 1011 1000 this d needs to be

[algogeeks] Re: Delete the node “next to the node pointed to by a given ptr” in a linked list in a one line code.

2009-01-24 Thread Piyush Kapoor
ptr-next = ptr-next-next , it will leave dangling pointer but the node wil be deleted On Fri, Jan 23, 2009 at 2:33 PM, Shivang agarwal.shiv...@gmail.com wrote: Hi all, I was stuck in this ques. Delete the node next to the node pointed to by a given ptr in a linked list in a one line code.