[algogeeks] Normal Form

2011-08-04 Thread krishna meena
1. A relation with two attributes is always in which form? options are
   4NF BCNF
5NF DK/NF

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread ankit sambyal
Can anybody explain following questions from the above interview:

Question:
   Output:
int main()
{
   char *str = “junk”;
   scanf (“%[A telephonic girl]”, str);
   printf (“%s\n”, str);
   return 0;
}



Question :  Data Structure that can be useful for the calculation like ab
mod m.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] pointer size

2011-08-04 Thread Dipankar Patro
there absolutely nothing wrong in your interpretation.
here is a link that might help : http://www.unix.org/whitepapers/64bit.html


On 4 August 2011 11:18, Shashank Jain shashan...@gmail.com wrote:

 see dipankar, i hv 64 bit OS nd processor bt i dont know abt the compiler.
 nd yeah size of int is 4 bytes. so tell me where im interpreting wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 11:16 AM, Dipankar Patro dip10c...@gmail.comwrote:

 This has been a hot topic of discussion for a long time. But I found there
 are two things to look into it:

 1. a 64 bit OS is one, which has 64 bit address handling capacity. and a
 64bit processor is one which can perform operations on 64 bit data. A
 general concept that actually gets overlooked by many. Even I was confused
 with differences of 64 bit OS and Processors a while back.

 2. if a compiler by it's own doesn't support 64 bit, it might be the case
 that even if you run on a 64 bit OS, size of int will be 4 bytes (32 bit).

 I think the best way to check out is to make a code on 64 bit compiler. If
 somebody has tried it please share the results.

 On 4 August 2011 10:38, Tushar Bindal tushicom...@gmail.com wrote:

 never assume that he compiler is same as the OS you run. it may be that
 you are running a 32-bit compiler

 I think pointers have size 4bytes on 8 byte compiler also - not sure.
 someone please correct me.


 On Thu, Aug 4, 2011 at 10:26 AM, Shashank Jain shashan...@gmail.comwrote:

 the size of a pointer is showing 4 bytes in my 64-bit OS, which should
 have been 8 bytes. Correct me where i am wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tushicom...@gmail.com
 Website: www.jugadengg.com


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] pointer size

2011-08-04 Thread Shashank Jain
man this is too big of a page to go thru...
so tell as both (OS nd pro) are 64 bit why is ptr size 4 bytes?
nd also does it depend on all 3 : OS, processor, compiler ?

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Thu, Aug 4, 2011 at 11:57 AM, Dipankar Patro dip10c...@gmail.com wrote:

 there absolutely nothing wrong in your interpretation.
 here is a link that might help :
 http://www.unix.org/whitepapers/64bit.html


 On 4 August 2011 11:18, Shashank Jain shashan...@gmail.com wrote:

 see dipankar, i hv 64 bit OS nd processor bt i dont know abt the compiler.
 nd yeah size of int is 4 bytes. so tell me where im interpreting wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 11:16 AM, Dipankar Patro dip10c...@gmail.comwrote:

 This has been a hot topic of discussion for a long time. But I found
 there are two things to look into it:

 1. a 64 bit OS is one, which has 64 bit address handling capacity. and a
 64bit processor is one which can perform operations on 64 bit data. A
 general concept that actually gets overlooked by many. Even I was confused
 with differences of 64 bit OS and Processors a while back.

 2. if a compiler by it's own doesn't support 64 bit, it might be the case
 that even if you run on a 64 bit OS, size of int will be 4 bytes (32 bit).

 I think the best way to check out is to make a code on 64 bit compiler.
 If somebody has tried it please share the results.

 On 4 August 2011 10:38, Tushar Bindal tushicom...@gmail.com wrote:

 never assume that he compiler is same as the OS you run. it may be that
 you are running a 32-bit compiler

 I think pointers have size 4bytes on 8 byte compiler also - not sure.
 someone please correct me.


 On Thu, Aug 4, 2011 at 10:26 AM, Shashank Jain shashan...@gmail.comwrote:

 the size of a pointer is showing 4 bytes in my 64-bit OS, which should
 have been 8 bytes. Correct me where i am wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tushicom...@gmail.com
 Website: www.jugadengg.com


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] pointer size

2011-08-04 Thread Dipankar Patro
For simple answer: yes.
All must be compatible with 64 bit data/address handling.

On 4 August 2011 12:02, Shashank Jain shashan...@gmail.com wrote:

 man this is too big of a page to go thru...
 so tell as both (OS nd pro) are 64 bit why is ptr size 4 bytes?
 nd also does it depend on all 3 : OS, processor, compiler ?

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 11:57 AM, Dipankar Patro dip10c...@gmail.comwrote:

 there absolutely nothing wrong in your interpretation.
 here is a link that might help :
 http://www.unix.org/whitepapers/64bit.html


 On 4 August 2011 11:18, Shashank Jain shashan...@gmail.com wrote:

 see dipankar, i hv 64 bit OS nd processor bt i dont know abt the
 compiler. nd yeah size of int is 4 bytes. so tell me where im interpreting
 wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 11:16 AM, Dipankar Patro dip10c...@gmail.comwrote:

 This has been a hot topic of discussion for a long time. But I found
 there are two things to look into it:

 1. a 64 bit OS is one, which has 64 bit address handling capacity. and a
 64bit processor is one which can perform operations on 64 bit data. A
 general concept that actually gets overlooked by many. Even I was confused
 with differences of 64 bit OS and Processors a while back.

 2. if a compiler by it's own doesn't support 64 bit, it might be the
 case that even if you run on a 64 bit OS, size of int will be 4 bytes (32
 bit).

 I think the best way to check out is to make a code on 64 bit compiler.
 If somebody has tried it please share the results.

 On 4 August 2011 10:38, Tushar Bindal tushicom...@gmail.com wrote:

 never assume that he compiler is same as the OS you run. it may be that
 you are running a 32-bit compiler

 I think pointers have size 4bytes on 8 byte compiler also - not sure.
 someone please correct me.


 On Thu, Aug 4, 2011 at 10:26 AM, Shashank Jain 
 shashan...@gmail.comwrote:

 the size of a pointer is showing 4 bytes in my 64-bit OS, which should
 have been 8 bytes. Correct me where i am wrong?

 Shashank Jain
 3rd year, Computer Engg.
 Delhi College of Engineering

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tushicom...@gmail.com
 Website: www.jugadengg.com


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
___

Please 

Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread Poised~
@ Ashish:
The function is for rounding off decimal numbers. how is -2 rounded off to 
-1?

@Gene:
Unfortunately, I was not selected in the first round itself :(

@ Sagar Pareek:
Thats what I missed, I should searched for the questions before hand to 
atleast clear the first round. No wonder the selections were a bit odd at 
our college.
Do you where Amazon has already visited?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/4_fdg4CBdPAJ.
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.



Re: [algogeeks] pointer size

2011-08-04 Thread N1teesh
So if either of the OS , Compiler , Processor are 32 Bit , then the size is 
bound to be 4 bytes?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/vsUrO_BCMXAJ.
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.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Nitish Garg
The input for the above code was hello world. So the output would be hello. 
As the input will stop on reading 'w'.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/oX1YmZcDR2MJ.
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.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread muthu raj
Can any one explain the  working of %[A telephonnic girl]
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*



On Thu, Aug 4, 2011 at 12:25 PM, Nitish Garg nitishgarg1...@gmail.comwrote:

 The input for the above code was hello world. So the output would be hello.
 As the input will stop on reading 'w'.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/oX1YmZcDR2MJ.

 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Doubt

2011-08-04 Thread Gaurav Popli
actually the questn should go like this.wud that be good
/optimised with space because we can use more storages for a tree
without freeing them

On Thu, Aug 4, 2011 at 10:09 AM, rajeev bharshetty rajeevr...@gmail.com wrote:
 Since you are maintaining two different data structures ,one for the old
 tree and the other for new tree . I think this isn't considered in-place
 algorithm . The algorithm to be in-place should not use any additional data
 structures .
 Correct me if I am wrong .
 On Thu, Aug 4, 2011 at 2:52 AM, Gaurav Popli abeygau...@gmail.com wrote:

 good quesn.i also want to knowjust in case

 On Thu, Aug 4, 2011 at 2:50 AM, Anurag Narain anuragnar...@gmail.com
 wrote:
  suppose there is a binary tree and i am creating another tree which is
  same
  as the previous one.
  but while creating the new tree i am freeing the nodes of my old
  tree(i.e.,
  i create one node in new tree and delete the corresponding node in old
  tree
  and continue the process till the new tree is formed which is same as
  old
  tree but the old tree now does not exist)
 
 
  would this conversion be considered in-place??
 
  --
  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 group at
  http://groups.google.com/group/algogeeks?hl=en.
 

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Regards
 Rajeev N B

 Winners Don't do Different things , they do things Differently

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Help on Recursion Bit Operators related problems

2011-08-04 Thread Navneet
bit twiddling hacks, a stanford resource.

http://graphics.stanford.edu/~seander/bithacks.html

On Aug 4, 10:55 am, Shashank Jain shashan...@gmail.com wrote:
 even this is a gud 
 1.http://www.cprogramming.com/tutorial/bitwise_operators.html

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering

 On Thu, Aug 4, 2011 at 1:35 AM, Samba Ganapavarapu 
 sambasiv...@gmail.comwrote:







  thanks raj,
  is this the bitwise operator tutorial that you told about ?

 http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=bitManipulation

  On Wed, Aug 3, 2011 at 3:48 PM, raj kumar megamonste...@gmail.com wrote:

  the best way to identify recursion is   when  finding solution to a
  problem consist of finding solution to a sub problem
  ex-5!=5*(4!)=5*4*(3!).
  for bits see topcoder tutorials on bitwise operators

  --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

   --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Nitin Nizhawan
its a regex. scanf will only accept characters in square brackets.

On Thu, Aug 4, 2011 at 12:45 PM, muthu raj muthura...@gmail.com wrote:

 Can any one explain the  working of %[A telephonnic girl]
 *Muthuraj R
 IV th Year , ISE
 PESIT , Bangalore*




 On Thu, Aug 4, 2011 at 12:25 PM, Nitish Garg nitishgarg1...@gmail.comwrote:

 The input for the above code was hello world. So the output would be
 hello. As the input will stop on reading 'w'.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/oX1YmZcDR2MJ.

 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.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Normal Form

2011-08-04 Thread ankit sambyal
BCNF

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Normal Form

2011-08-04 Thread aman jain
yeah bcnf

On Thu, Aug 4, 2011 at 1:06 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 BCNF

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Aman Jain
M.Tech(Information System) Final Year
Placement Coordinator
Delhi Technological University
(Formerly Delhi College of Engineering)

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread Nathiya Perumal
see first its performing the operation (-2+0.5) so the ans is -1.5 and then
its rounding off.. the final ans is -1.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Arun Vishwanathan
there are 12 black and 12 white socks
p(bb)+p(ww) is what we want...

p(bb)=12/24*11/23
p(ww)=12/24*11/23

so it is just 2*12/24*11/23=11/23

On Wed, Aug 3, 2011 at 9:08 PM, Prakash D cegprak...@gmail.com wrote:

 no.. it's really easy to find it out

 there are 12 black and 12 white pieces.

 let black =1  and white =0

 the possible results are 11, 00, 10, 01


 number of ways of 11 solutions=  12 * 11 =  132
 number of ways of 00 solutions = 12 * 11 = 132
 number of ways of 10 solutions = 12 * 12 = 144
 number of ways of 01 solutions = 12 * 12 = 144


 we need the prob of 10 + prob 01 ==  (144+144)/(132+ 132 + 144 + 144)

 =288/552 =  36/69 = 12/23

 I think 11/23 is wrong




 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Google Interview preparation

2011-08-04 Thread Amit Mittal
I have my google interview at the end of this month.
can any body provide me some tips/suggestions/questions ?
I am sure some of you guys here must have appeared in google interviews
before,
your help will be very valuable and much appreciated.


Thanks

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Directi on campus

2011-08-04 Thread sagar pareek
well i reached upto interview

mcq were already told by srinivasan

then they sort out students in two buckets
1. sys developer
2. sys analyst

i was selected as sys analyst
then they took coding round :-

in sys analyst they gave a log file having eppoch time stamp enclode in [ ]
. u have to find all logs last X hours , b/w 1pm to 2 pm and all logs

in sys dev they gave a rectangle and u have to find all possible paths



i cleared the coding round too

then i had 3 interview rounds.
1. telephonic from bombay(tech)
2. face to face (tech)
3. HR

u have to prepare shell scripting(or any other language based on
scripting)...they are not gonna ask u in C
networking specially DNS (books are not sufficient go google it for advance)
port numbers (be specific like i got confused in 20 and 21 port numbers of
FTP)
subnetting
and all

i got rejected only due to one reason...i am doing M.Tech  not B.Tech   :(
:(


On Thu, Aug 4, 2011 at 12:42 AM, raj kumar megamonste...@gmail.com wrote:

 which profile are you talking about dude.
 system administrator or developer

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/97Hv5OzD0PAJ.

 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
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread Ankur Khurana
I dont know , but the double function question was highly ambigous one. They
were satified by my arguements whie giving written test and asked me write
explaintation down but still they went on to deduct two marks. Kaafi strange
tha..

On Thu, Aug 4, 2011 at 1:33 PM, Nathiya Perumal contactnath...@gmail.comwrote:

 see first its performing the operation (-2+0.5) so the ans is -1.5 and then
 its rounding off.. the final ans is -1.

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
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 this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Shashank Jain
whats the priority of ^ symbol?

Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering



On Thu, Aug 4, 2011 at 1:52 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote:

 there are 12 black and 12 white socks
 p(bb)+p(ww) is what we want...

 p(bb)=12/24*11/23
 p(ww)=12/24*11/23

 so it is just 2*12/24*11/23=11/23

 On Wed, Aug 3, 2011 at 9:08 PM, Prakash D cegprak...@gmail.com wrote:

 no.. it's really easy to find it out

 there are 12 black and 12 white pieces.

 let black =1  and white =0

 the possible results are 11, 00, 10, 01


 number of ways of 11 solutions=  12 * 11 =  132
 number of ways of 00 solutions = 12 * 11 = 132
 number of ways of 10 solutions = 12 * 12 = 144
 number of ways of 01 solutions = 12 * 12 = 144


 we need the prob of 10 + prob 01 ==  (144+144)/(132+ 132 + 144 + 144)

 =288/552 =  36/69 = 12/23

 I think 11/23 is wrong




 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread Amol Sharma
someone explain the 3rd question of section 2 related to the datastructure
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Thu, Aug 4, 2011 at 1:42 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 I dont know , but the double function question was highly ambigous one.
 They were satified by my arguements whie giving written test and asked me
 write explaintation down but still they went on to deduct two marks. Kaafi
 strange tha..


 On Thu, Aug 4, 2011 at 1:33 PM, Nathiya Perumal 
 contactnath...@gmail.comwrote:

 see first its performing the operation (-2+0.5) so the ans is -1.5 and
 then its rounding off.. the final ans is -1.

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Ankur Khurana
 Computer Science
 Netaji Subhas Institute Of Technology
 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 this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread sagar pareek
@poised
yeah

On Thu, Aug 4, 2011 at 2:18 PM, Amol Sharma amolsharm...@gmail.com wrote:

 someone explain the 3rd question of section 2 related to the datastructure
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Thu, Aug 4, 2011 at 1:42 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 I dont know , but the double function question was highly ambigous one.
 They were satified by my arguements whie giving written test and asked me
 write explaintation down but still they went on to deduct two marks. Kaafi
 strange tha..


 On Thu, Aug 4, 2011 at 1:33 PM, Nathiya Perumal contactnath...@gmail.com
  wrote:

 see first its performing the operation (-2+0.5) so the ans is -1.5 and
 then its rounding off.. the final ans is -1.

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Ankur Khurana
 Computer Science
 Netaji Subhas Institute Of Technology
 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 this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Normal Form

2011-08-04 Thread ghsjgl k
can u explain ???

On Thu, Aug 4, 2011 at 1:19 PM, aman jain amanjain@gmail.com wrote:

 yeah bcnf


 On Thu, Aug 4, 2011 at 1:06 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 BCNF

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Aman Jain
 M.Tech(Information System) Final Year
 Placement Coordinator
 Delhi Technological University
 (Formerly Delhi College of Engineering)



  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Normal Form

2011-08-04 Thread Vijay Khandar
becoz , Consider two Attributes,  A B
then possibility are, 1)AB is a key then directly in BCNF,
2)A is a key then automaticaly B is depend on A
3)vice versa of 2)
so
A relation with two attributes is always 2Nf,3nf and also in BCNF form.

Vijay

On Thu, Aug 4, 2011 at 2:51 PM, ghsjgl k ghsk...@gmail.com wrote:

 can u explain ???


 On Thu, Aug 4, 2011 at 1:19 PM, aman jain amanjain@gmail.com wrote:

 yeah bcnf


 On Thu, Aug 4, 2011 at 1:06 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 BCNF

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Aman Jain
 M.Tech(Information System) Final Year
 Placement Coordinator
 Delhi Technological University
 (Formerly Delhi College of Engineering)



  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-04 Thread parth panchal
h nikhil how are you

On Thu, Aug 4, 2011 at 3:57 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 You have 2 identical ropes that burn in 1 hour (with non-uniform rate).
 How will you measure 45 minutes using them?

 --
 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 to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-04 Thread Priyanka
Lit the first rope on both the ends and simultaneously lit the second rope
on one end.
Now first rope will take 30mins to burn completely, and by that time second
rope is half burnt.
then lit the second end of 2nd rope which will burn for 15mins
so altogerther u can measure 45 mins

On Thu, Aug 4, 2011 at 3:57 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 You have 2 identical ropes that burn in 1 hour (with non-uniform rate).
 How will you measure 45 minutes using them?

 --
 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 to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
with regards,
Priyanka Loya

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



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 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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Fwd: Solve dis!

2011-08-04 Thread jestincobol nair
-- Forwarded message --
From: jestincobol nair jestinco...@gmail.com
Date: Thu, Aug 4, 2011 at 4:33 PM
Subject: Solve dis!



*Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
musician. The one who was not last or first was a math major. The one who
came in third had black hair. Linda had red hair. Amy had no musical
abilities. Who was first?*

(A) Cindy (B) Amy (C) Linda (D) None of these

 * Two twins have certain peculiar characteristics. One of them always lies
on Monday, Wednesday, Friday. The other always lies on Tuesdays, Thursday
and Saturdays. On the other days they tell the truth. You are given a
conversation.
Person A- today is Sunday, my name is Anil
Person B-today is Tuesday, my name is Bill What day is today?*

(A) Sunday (B) Tuesday (C) Monday (D) Thursday

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-04 Thread Nitish Garg
When the first rope is completely burnt after 30 minutes, the length of rope 
2 remaining would be such that it would burn completely in the next 30 
minutes, so if at this moment the rope 2 is lit at other end also, it will 
burn completely in 15 min more, thereby giving a time of 45 min.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/MBbN_6CQEEgJ.
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.



Re: [algogeeks] Puzzle

2011-08-04 Thread anubhav gupta
both ropes have to burn in one hour.. so if burn first rope at both ends it
wil definitely take 30 mins to burn completely no matter how non uniform
burning is.. when first rope burn out completly(after 30 mins) second rope
still have 30 mins left for complete burning so if  it is burn at both ends
it wil take half the time left i.e 15 mins .. so in total we get 45 mins

On Thu, Aug 4, 2011 at 4:32 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 @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 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] netapp

2011-08-04 Thread naveen ms
hey can any1 post me where i can find source to prepare for netapp.


thanks in advance

naveen

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] C++ doubt

2011-08-04 Thread Shachindra A C
Hi All,

  In the code below, even though pD is actually pointing to a base
class object, how is the print function being successfully called?

#includeiostream

class base
{
public:
int BVal;
base()
{
BVal = 100;
}
};

class derived : public base
{
public:
derived()
{
DVal = 500;
}
void print()
{
std::cout\nBVal =BValstd::endlDVal = DValstd::endl;
}
int DVal;
};

int main()
{
base B;
derived D;
derived *pD;
*pD = static_castderived*(B);*
*pD-print();*
return 0;
}

-- 
Regards,
Shachindra A C

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-04 Thread Shachindra A C
Calibrate both the ropes and burn 1 rope from both ends. It will take half
an hour. Then note down the point where the rope fully burns out. Cut the
second rope at this point and fire both ends of any one of the pieces. This
will take 15 mins.

On Thu, Aug 4, 2011 at 4:54 PM, anubhav gupta anubhav.7...@gmail.comwrote:

 both ropes have to burn in one hour.. so if burn first rope at both ends it
 wil definitely take 30 mins to burn completely no matter how non uniform
 burning is.. when first rope burn out completly(after 30 mins) second rope
 still have 30 mins left for complete burning so if  it is burn at both ends
 it wil take half the time left i.e 15 mins .. so in total we get 45 mins


 On Thu, Aug 4, 2011 at 4:32 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 @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 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards,
Shachindra A C

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-04 Thread Abhinav Arora
@Nikhil : This question was asked to 2 people during Adobe interview on 
Tuesdaythe above solutions are perfectly alright.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/Bx9FHS_7aRMJ.
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.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread sagar pareek
1. i am not sure abt cindy or linda...

2. tuesday

On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair jestinco...@gmail.comwrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread shady
^ it is cindy
1-cindy
2-linda
3-amy

On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.com wrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair jestinco...@gmail.comwrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread sagar pareek
@shady why cindy not linda?

On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.comwrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Dave
@Amit: It is given that the array is decreasing, then increasing. An
array of constants is neither increasing nor decreasing.

Dave

On Aug 3, 11:41 pm, amit karmakar amit.codenam...@gmail.com wrote:
 Can you show how to find k for an array containing n 2's using binary
 search.

 On Aug 4, 6:29 am, Dave dave_and_da...@juno.com wrote:



  @Amit: If k is not known, you can find it with another binary search.

  Dave

  On Aug 3, 3:02 pm, amit karmakar amit.codenam...@gmail.com wrote:

   I think for question 1, the value of k is not provided, right?

   On Aug 4, 12:53 am, Ankur Garg ankurga...@gmail.com wrote:

Dave's solution looks gud to me :)

On Wed, Aug 3, 2011 at 3:52 PM, Ankur Garg ankurga...@gmail.com wrote:
 Q1 can be looked as rotated sorted array...check whether the no is 
 less or
 greater than kth element ..if greater search using binary search with 
 low =0
 high k-1 and if less earch in right with low=k+1 high =n;

 q2) Dont know :(

 On Wed, Aug 3, 2011 at 3:44 PM, Dave dave_and_da...@juno.com wrote:

 @Tushar: For problem 1, do a binary search on elements 1 to k, and if
 no hit is found, do a binary search on elements k+1 to n.

 For problem 2, suppose that you are searching the given array for the
 number 2. The idea is to take big steps when you are far from the
 target, and small steps when you are close. Start with i = 0. If 
 a[i] !
 = 2, then add abs(a[i]-2) to i and try again. This is because it will
 take at least abs(a[i]-2) steps to get to 2.

  In this case, i = 0 and a[0] = 6, so add 4 to i, getting 4. a[4] = 
 4,
 so add 2 to i, getting 6. a[6] = 3, so add 1. a[7] = 2.

 Dave

 On Aug 3, 2:09 pm, TUSHAR tusharkanta.r...@gmail.com wrote:
  1.   Given an array of n-elements ? the 1st k -elements are in
  descending order and k+1 to n elements are in
        ascending order. give an  efficient algo for searching an
  element ?

  2.  Given an array of n-elements ? each element in the array is 
  either
  same or less by 1 or larger by 1 from the
       previous element . give an  efficient algo for searching an
  element ?

            e.g :   6 6 6 5 4 4 3 2 3 4 3 4 

 --
 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 group at
http://groups.google.com/group/algogeeks?hl=en.-Hidequoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Dave
@Kartik: k can be found with a binary search. Once k is known, the key
can be found with one or two binary searches. O(log n).

Dave

On Aug 3, 11:08 pm, kartik sachan kartik.sac...@gmail.com wrote:
 if k is known to us the searching can be done in log(n) time

 if k is not known to us ,we first find the k then solution in O(n) time

 correct me if i am worng...

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Dave
@Tushar: Either value of k will work. You are going to search both
sides of k.

Dave

On Aug 3, 10:59 pm, Tushar Bindal tushicom...@gmail.com wrote:
 if we do not know k, how do we find it?

 inthe series : 17 15 13 11 9 1 3 5 7

 we can take k at element 1 also as the descending series can be 17 15 13 11
 9 1 and ascending 3 5 7
 OR
 descending 17 15 13 11 9 and ascending 1 3 5 7
 isn't there any relationship in kth and (k+1)th element that helps us find
 out k correctly

 On Thu, Aug 4, 2011 at 7:37 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:





  For question two ,
  try this.

  see te element at arr[0] . and supose you have to find k . if arr[0]==k ,
  then yes we found the element else see the diff betweem arr[0] and k. that
  will be minimum amount of steps needed to convert a[0] to k(let abs(a[0]-k)
  = p). then repeat the procedure again at the new element arr[p] untill you
  find the number of reach end of array..

  On Thu, Aug 4, 2011 at 6:59 AM, Dave dave_and_da...@juno.com wrote:

  @Amit: If k is not known, you can find it with another binary search.

  Dave

  On Aug 3, 3:02 pm, amit karmakar amit.codenam...@gmail.com wrote:
   I think for question 1, the value of k is not provided, right?

   On Aug 4, 12:53 am, Ankur Garg ankurga...@gmail.com wrote:

Dave's solution looks gud to me :)

On Wed, Aug 3, 2011 at 3:52 PM, Ankur Garg ankurga...@gmail.com
  wrote:
 Q1 can be looked as rotated sorted array...check whether the no is
  less or
 greater than kth element ..if greater search using binary search
  with low =0
 high k-1 and if less earch in right with low=k+1 high =n;

 q2) Dont know :(

 On Wed, Aug 3, 2011 at 3:44 PM, Dave dave_and_da...@juno.com
  wrote:

 @Tushar: For problem 1, do a binary search on elements 1 to k, and
  if
 no hit is found, do a binary search on elements k+1 to n.

 For problem 2, suppose that you are searching the given array for
  the
 number 2. The idea is to take big steps when you are far from the
 target, and small steps when you are close. Start with i = 0. If
  a[i] !
 = 2, then add abs(a[i]-2) to i and try again. This is because it
  will
 take at least abs(a[i]-2) steps to get to 2.

  In this case, i = 0 and a[0] = 6, so add 4 to i, getting 4. a[4] =
  4,
 so add 2 to i, getting 6. a[6] = 3, so add 1. a[7] = 2.

 Dave

 On Aug 3, 2:09 pm, TUSHAR tusharkanta.r...@gmail.com wrote:
  1.   Given an array of n-elements ? the 1st k -elements are in
  descending order and k+1 to n elements are in
        ascending order. give an  efficient algo for searching an
  element ?

  2.  Given an array of n-elements ? each element in the array is
  either
  same or less by 1 or larger by 1 from the
       previous element . give an  efficient algo for searching an
  element ?

            e.g :   6 6 6 5 4 4 3 2 3 4 3 4 

 --
 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 group at
http://groups.google.com/group/algogeeks?hl=en.-Hide quoted text -

   - Show quoted text -

  --
  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 group at
 http://groups.google.com/group/algogeeks?hl=en.

  --
  Ankur Khurana
  Computer Science
  Netaji Subhas Institute Of Technology
  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 this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

 --
 Tushar Bindal
 Computer Engineering
 Delhi College of Engineering
 Mob: +919818442705
 E-Mail : tushicom...@gmail.com
 Website:www.jugadengg.com- Hide quoted text -

 - Show quoted text -

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: friend function

2011-08-04 Thread Amir
*// Using friend functions to overload addition and subtarction operators*
#include iostream.h

class myclass
{
int a;
int b;

public:
myclass(){}
myclass(int x,int y){a=x;b=y;}
void show()
{
coutaendlbendl;
}

*// these are friend operator functions
// NOTE: Both the operans will be be passed explicitely. operand to the left 
of the operator will be passed as the first argument and operand to the 
right as the second argument
*friend myclass operator+(myclass,myclass);
friend myclass operator-(myclass,myclass);

};

myclass operator+(myclass ob1,myclass ob2)
{
myclass temp;

temp.a = ob1.a + ob2.a;
temp.b = ob1.b + ob2.b;

return temp;
}

myclass operator-(myclass ob1,myclass ob2)
{
myclass temp;

temp.a = ob1.a - ob2.a;
temp.b = ob1.b - ob2.b;

return temp;
}

void main()
{
myclass a(10,20);
myclass b(100,200);

a=a+b;

a.show();
}

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/WzSQS2w4i3UJ.
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.



Re: [algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Gaurav Menghani
Problem 2 can be solved in O(n/k).

If you want to search for x, look at the first element. If the element
is not found, find the difference between the current element and x,
let this be stored in diff. Now, x will be atleast diff number of
positions ahead in the array. So, the next position is current
position + diff. If the element is still not found, continue.

On Thu, Aug 4, 2011 at 5:27 PM, Dave dave_and_da...@juno.com wrote:
 @Amit: It is given that the array is decreasing, then increasing. An
 array of constants is neither increasing nor decreasing.

 Dave

 On Aug 3, 11:41 pm, amit karmakar amit.codenam...@gmail.com wrote:
 Can you show how to find k for an array containing n 2's using binary
 search.

 On Aug 4, 6:29 am, Dave dave_and_da...@juno.com wrote:



  @Amit: If k is not known, you can find it with another binary search.

  Dave

  On Aug 3, 3:02 pm, amit karmakar amit.codenam...@gmail.com wrote:

   I think for question 1, the value of k is not provided, right?

   On Aug 4, 12:53 am, Ankur Garg ankurga...@gmail.com wrote:

Dave's solution looks gud to me :)

On Wed, Aug 3, 2011 at 3:52 PM, Ankur Garg ankurga...@gmail.com 
wrote:
 Q1 can be looked as rotated sorted array...check whether the no is 
 less or
 greater than kth element ..if greater search using binary search 
 with low =0
 high k-1 and if less earch in right with low=k+1 high =n;

 q2) Dont know :(

 On Wed, Aug 3, 2011 at 3:44 PM, Dave dave_and_da...@juno.com wrote:

 @Tushar: For problem 1, do a binary search on elements 1 to k, and 
 if
 no hit is found, do a binary search on elements k+1 to n.

 For problem 2, suppose that you are searching the given array for 
 the
 number 2. The idea is to take big steps when you are far from the
 target, and small steps when you are close. Start with i = 0. If 
 a[i] !
 = 2, then add abs(a[i]-2) to i and try again. This is because it 
 will
 take at least abs(a[i]-2) steps to get to 2.

  In this case, i = 0 and a[0] = 6, so add 4 to i, getting 4. a[4] = 
 4,
 so add 2 to i, getting 6. a[6] = 3, so add 1. a[7] = 2.

 Dave

 On Aug 3, 2:09 pm, TUSHAR tusharkanta.r...@gmail.com wrote:
  1.   Given an array of n-elements ? the 1st k -elements are in
  descending order and k+1 to n elements are in
        ascending order. give an  efficient algo for searching an
  element ?

  2.  Given an array of n-elements ? each element in the array is 
  either
  same or less by 1 or larger by 1 from the
       previous element . give an  efficient algo for searching an
  element ?

            e.g :   6 6 6 5 4 4 3 2 3 4 3 4 

 --
 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 group at
http://groups.google.com/group/algogeeks?hl=en.-Hidequoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -

 --
 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 group at 
 http://groups.google.com/group/algogeeks?hl=en.





-- 
Gaurav Menghani

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Give an efficient search algo

2011-08-04 Thread kartik sachan
@amit it's given that array is increasing then decreasing..so where
there is change from incre to drece that value of i in loop will be k

in this we can find out k if not given

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread mithun bs
Ya, Tuesday is right. Quiet simple

On Sunday both should say truth. If only one guy says it is sunday it should
be a lie.
So the answer should be Tuesday only.

On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.com wrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.comwrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Mithun.B.S
M:9916775380

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread jestincobol nair
@shady : logic for selecting cindy ??
  And yes Tuesday is obvious :)

On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair jestinco...@gmail.com
  wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS [Written Question]

2011-08-04 Thread Poised~
@ Nathiya: My statement was a question to whether the function is working or 
not. I know how -2 in converted to -1 :P

@ All: The question is actually to tell whether the function mentioned will 
work for rounding off or not.
The answer is half the times. It doesn't work for negative numbers.

@ Ankur Khurana:
I didn't mark it due to the type mismatch in *return*. Very doubtful if you 
haven't tried the same thing anywhere before.

@ John_geek:
The question is actually a good one. I wrote linked list, but I am sure 
there is a better data structure.
One of my friends suggested to use a variable array. This way calculations 
can be fast. According to my friend, you should know how to use realloc() so 
that, in case of varying length of numbers, the size can also be adjusted.
I think there is not a specific answer to this question. You have to explain 
in argument, why you chose the data structure perfectly.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/KCgLW7nwSscJ.
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.



[algogeeks] Re: implement next_permutation

2011-08-04 Thread DK
@Grapher: Please look at that post carefully. The code given generates the 
next lexicographical permutation - which is exactly what you want.

--
DK

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/ttEZ6xlhKwoJ.
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.



Re: [algogeeks] Puzzle

2011-08-04 Thread aditi garg
Well acc to me the solution should be light the frst one on both ends(half
an hr)After rope one is completely burnt, fr the second one fold the rope in
the middle and then light it from both ends.it will take 15 minstotal 45
mins...please let me know if thr is any flaw in this

On Thu, Aug 4, 2011 at 5:18 PM, Abhinav Arora abhinavdgr8b...@gmail.comwrote:

 @Nikhil : This question was asked to 2 people during Adobe interview on
 Tuesdaythe above solutions are perfectly alright.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/Bx9FHS_7aRMJ.

 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.




-- 
Aditi Garg
Undergraduate Student
Electronics  Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New 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 this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Poised~
If you guys see the question properly it says,

char *str = junk;

str points to a read only memory and can't be written over with any method.
Since there is no change in str. Hence the output will be junk, 
irrespective of any input.

regex has been properly explained as above.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/GLn4nI896ZkJ.
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.



Re: [algogeeks] Amazon Question

2011-08-04 Thread himanshu kansal
okie...can someone do it in O(n) space...bt time shld be linear only

On Thu, Aug 4, 2011 at 2:13 AM, Prakash D cegprak...@gmail.com wrote:

 O(1) space is t hard  for this task


 On Thu, Aug 4, 2011 at 12:55 AM, payel roy smithpa...@gmail.com wrote:

 Is there any solution for the above?


 On 3 August 2011 21:09, coder coder i.code.program...@gmail.com wrote:

 ya amazon will be visiting our campus within few days

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

  Regards
Himanshu Kansal
  Msc Comp. sc.
(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 this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread shady
apologies, both cindy or linda could be first... cindy was satisfying
constraints so i answered that...

On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread jestincobol nair
oh ok thanks :)


On Thu, Aug 4, 2011 at 6:29 PM, shady sinv...@gmail.com wrote:

 apologies, both cindy or linda could be first... cindy was satisfying
 constraints so i answered that...


 On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one 
 who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Aricent is coming..

2011-08-04 Thread WgpShashank
Hi Akshay You May Like it http://shashank7s.blogspot.com/

Thanks
Shashank Mani
Computer Science
Birla Institute of Technology Meara 

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/mf4zXldKtXQJ.
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.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread muthu raj
@poised: Since it is read only memory junk will be the output if and only if
we enter any string containing characters not inside []. If we try
entering something present within [] i am getting segmentation fault.



*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*



On Thu, Aug 4, 2011 at 6:21 PM, Poised~ dip10c...@gmail.com wrote:

 If you guys see the question properly it says,

 char *str = junk;

 str points to a read only memory and can't be written over with any method.
 Since there is no change in str. Hence the output will be junk,
 irrespective of any input.

 regex has been properly explained as above.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/GLn4nI896ZkJ.

 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Help on Recursion Bit Operators related problems

2011-08-04 Thread Samba Ganapavarapu
thank you Shashank  navneet

- Samba

On Thu, Aug 4, 2011 at 3:24 AM, Navneet navneetn...@gmail.com wrote:

 bit twiddling hacks, a stanford resource.

 http://graphics.stanford.edu/~seander/bithacks.html

 On Aug 4, 10:55 am, Shashank Jain shashan...@gmail.com wrote:
  even this is a gud 1.
 http://www.cprogramming.com/tutorial/bitwise_operators.html
 
  Shashank Jain
  IIIrd year
  Computer Engineering
  Delhi College of Engineering
 
  On Thu, Aug 4, 2011 at 1:35 AM, Samba Ganapavarapu 
 sambasiv...@gmail.comwrote:
 
 
 
 
 
 
 
   thanks raj,
   is this the bitwise operator tutorial that you told about ?
 
  
 http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=bitManipulation
 
   On Wed, Aug 3, 2011 at 3:48 PM, raj kumar megamonste...@gmail.com
 wrote:
 
   the best way to identify recursion is   when  finding solution to a
   problem consist of finding solution to a sub problem
   ex-5!=5*(4!)=5*4*(3!).
   for bits see topcoder tutorials on bitwise operators
 
   --
   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 group at
  http://groups.google.com/group/algogeeks?hl=en.
 
--
   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 group at
  http://groups.google.com/group/algogeeks?hl=en.

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread priya v
How is the answer for the first q cindy?

On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

  * Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Niteesh Mehra
This was the actual statement in the question :

*char *str;*
*strcpy(str,junk);*
scanf(%[A telephonic girl],str);
printf(%s,str);

And the input was - hello world! .

So , the output should be - hello.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/NeCnfEo7WuQJ.
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.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread arvind kumar
Cos Linda and Amy are eliminated jus by seein d given conditions

On Thu, Aug 4, 2011 at 6:57 PM, priya v pria@gmail.com wrote:

 How is the answer for the first q cindy?

 On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one 
 who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

 *Two twins have certain peculiar characteristics. One of them always
 lies on Monday, Wednesday, Friday. The other always lies on Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread mithun bs
Arvind,
By which condition are you eliminating Linda?

On Thu, Aug 4, 2011 at 6:59 PM, arvind kumar arvindk...@gmail.com wrote:

 Cos Linda and Amy are eliminated jus by seein d given conditions


 On Thu, Aug 4, 2011 at 6:57 PM, priya v pria@gmail.com wrote:

 How is the answer for the first q cindy?

 On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair 
 jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek 
 sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner was
 musician. The one who was not last or first was a math major. The one 
 who
 came in third had black hair. Linda had red hair. Amy had no musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

 *Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You are 
 given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Mithun.B.S
M:9916775380

-- 
You received this 

Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread priya v
I got this as my answer-
First place- Cindy or Linda
Second Place- C or L or A
Third place- C or A
How is it possible to eliminate any other possibility. Any condition
missing?

On Thu, Aug 4, 2011 at 7:02 PM, mithun bs mithun...@gmail.com wrote:

 Arvind,
 By which condition are you eliminating Linda?


 On Thu, Aug 4, 2011 at 6:59 PM, arvind kumar arvindk...@gmail.com wrote:

 Cos Linda and Amy are eliminated jus by seein d given conditions


 On Thu, Aug 4, 2011 at 6:57 PM, priya v pria@gmail.com wrote:

 How is the answer for the first q cindy?

 On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair 
 jestinco...@gmail.comwrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek 
 sagarpar...@gmail.comwrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner
 was musician. The one who was not last or first was a math major. The 
 one
 who came in third had black hair. Linda had red hair. Amy had no 
 musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

 *Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You 
 are given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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] pointer size

2011-08-04 Thread Dipankar Patro
Yeah.

On 4 August 2011 12:14, N1teesh nitee...@gmail.com wrote:

 So if either of the OS , Compiler , Processor are 32 Bit , then the size is
 bound to be 4 bytes?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vsUrO_BCMXAJ.

 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.




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] pointer size

2011-08-04 Thread Dipankar Patro
Also, you must remember that 64 OS can never run 32 bit Processors, since it
will require a 64 bit CPU to produce a 64bit address format

On 4 August 2011 19:19, Dipankar Patro dip10c...@gmail.com wrote:

 Yeah.

 On 4 August 2011 12:14, N1teesh nitee...@gmail.com wrote:

 So if either of the OS , Compiler , Processor are 32 Bit , then the size
 is bound to be 4 bytes?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vsUrO_BCMXAJ.

 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.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Amol Sharma
@saurabh: see this case
input 100, 1, 1, 1,1

your algo -
group 1 - 100
group 2 - 1 1 1 1

but the group with 2 equal strength can be formed as
G1 - 1 1
G2 - 1 1 or 1 1 each...
i mean it is not necessary to take all the people.but your algo takes
the the person with max strength at startwhich is not correct..there
will be many cases where it will fail

it might be correct if it is compulsory to take all the persons in the two
groups

a knapsack dp solution will be the best for this particular problem...if u
can thin of any other approach then suggest !!

P.S : Sorry for replying after such a long time  :P
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Mon, Aug 1, 2011 at 2:00 AM, Nitish Garg nitishgarg1...@gmail.comwrote:

 Can you explain a bit more?
 Thanks
 Nitish Garg

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/-LiQq0dHHksJ.

 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] pointer size

2011-08-04 Thread Ashish kumar Jain
Just check if you have installed DEV Cpp win32 installation or not.That will
confirm the usage and observation.As per the Dev cpp page it is available in
32 bit exe only.

On Thu, Aug 4, 2011 at 7:21 PM, Dipankar Patro dip10c...@gmail.com wrote:

 Also, you must remember that 64 OS can never run 32 bit Processors, since
 it will require a 64 bit CPU to produce a 64bit address format


 On 4 August 2011 19:19, Dipankar Patro dip10c...@gmail.com wrote:

 Yeah.

 On 4 August 2011 12:14, N1teesh nitee...@gmail.com wrote:

 So if either of the OS , Compiler , Processor are 32 Bit , then the size
 is bound to be 4 bytes?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vsUrO_BCMXAJ.

 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.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards,
Ashish

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread saurabh singh
Hence shown never play cricket when someone in the group is stronger than
the whole team together,,,:D
Anyways my original solution was not taking into account that players can be
excluded.(Thats unfair in a real scenario ryt?)
Its a classical 0/1 knapsack problem which can be implemented either as a
greedy solution or dp

On Thu, Aug 4, 2011 at 7:26 PM, Amol Sharma amolsharm...@gmail.com wrote:

 @saurabh: see this case
 input 100, 1, 1, 1,1

 your algo -
 group 1 - 100
 group 2 - 1 1 1 1

 but the group with 2 equal strength can be formed as
 G1 - 1 1
 G2 - 1 1 or 1 1 each...
 i mean it is not necessary to take all the people.but your algo takes
 the the person with max strength at startwhich is not correct..there
 will be many cases where it will fail

 it might be correct if it is compulsory to take all the persons in the two
 groups

 a knapsack dp solution will be the best for this particular problem...if u
 can thin of any other approach then suggest !!

 P.S : Sorry for replying after such a long time  :P

 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Mon, Aug 1, 2011 at 2:00 AM, Nitish Garg nitishgarg1...@gmail.comwrote:

 Can you explain a bit more?
 Thanks
 Nitish Garg

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/-LiQq0dHHksJ.

 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.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Pointers

2011-08-04 Thread arvind kumar
Hi
Can any1 suggest some good book/website to learn pointers,and
stacks,queues etc..in depth.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Gaurav Menghani
On Thu, Aug 4, 2011 at 7:37 PM, saurabh singh saurab...@gmail.com wrote:

 Its a classical 0/1 knapsack problem which can be implemented either as a
 greedy solution or dp


It has been stated earlier in the thread that this is an 'NP-Complete'
problem. [0]

It means, there is no known polynomial-time algorithm for this problem. If
you think you have a greedy solution to this problem, think again. The DP
solution is also, 'pseudo-polynomial-time'

[0] http://en.wikipedia.org/wiki/Partition_problem
-- 
Gaurav Menghani

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] amazon visit

2011-08-04 Thread coder coder
amazon will be visiting our campus within few days
any ideas about their pattern especially their online test
the questions asked by them and where they have visited recently for
campus placement

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Gaurav Menghani
On Thu, Aug 4, 2011 at 7:42 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:

 On Thu, Aug 4, 2011 at 7:37 PM, saurabh singh saurab...@gmail.com wrote:

 Its a classical 0/1 knapsack problem which can be implemented either as a
 greedy solution or dp

 It has been stated earlier in the thread that this is an 'NP-Complete'
 problem. [0]
 It means, there is no known polynomial-time algorithm for this problem. If
 you think you have a greedy solution to this problem, think again. The DP
 solution is also, 'pseudo-polynomial-time'

Just adding, greedy solutions are always possible, but the thing to
ponder over is, whether they give optimal solutions _for_every_case_
or not.


-- 
Gaurav Menghani

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Amol Sharma
@gaurav: agree...greedy wouldn't work in this case..even 0-1 knapsack is
a DP problem...which can't be done by greedy !!
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Thu, Aug 4, 2011 at 7:46 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:

 On Thu, Aug 4, 2011 at 7:42 PM, Gaurav Menghani
 gaurav.mengh...@gmail.com wrote:
 
  On Thu, Aug 4, 2011 at 7:37 PM, saurabh singh saurab...@gmail.com
 wrote:
 
  Its a classical 0/1 knapsack problem which can be implemented either as
 a
  greedy solution or dp
 
  It has been stated earlier in the thread that this is an 'NP-Complete'
  problem. [0]
  It means, there is no known polynomial-time algorithm for this problem.
 If
  you think you have a greedy solution to this problem, think again. The DP
  solution is also, 'pseudo-polynomial-time'

 Just adding, greedy solutions are always possible, but the thing to
 ponder over is, whether they give optimal solutions _for_every_case_
 or not.


 --
 Gaurav Menghani

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread saurabh singh
@amol knapsack is originaly a greedy problem onlyThe spirit remains
the same,selecting the best at each stepDp helps in defining the best in
  the particular case.
@Gaurav I think its NP complete once the number of teams become
varaible,
corrct me if wrong i am weak with the theoritical stuffs...

On Thu, Aug 4, 2011 at 8:06 PM, Amol Sharma amolsharm...@gmail.com wrote:

 @gaurav: agree...greedy wouldn't work in this case..even 0-1 knapsack
 is a DP problem...which can't be done by greedy !!
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Thu, Aug 4, 2011 at 7:46 PM, Gaurav Menghani gaurav.mengh...@gmail.com
  wrote:

 On Thu, Aug 4, 2011 at 7:42 PM, Gaurav Menghani
 gaurav.mengh...@gmail.com wrote:
 
  On Thu, Aug 4, 2011 at 7:37 PM, saurabh singh saurab...@gmail.com
 wrote:
 
  Its a classical 0/1 knapsack problem which can be implemented either as
 a
  greedy solution or dp
 
  It has been stated earlier in the thread that this is an 'NP-Complete'
  problem. [0]
  It means, there is no known polynomial-time algorithm for this problem.
 If
  you think you have a greedy solution to this problem, think again. The
 DP
  solution is also, 'pseudo-polynomial-time'

 Just adding, greedy solutions are always possible, but the thing to
 ponder over is, whether they give optimal solutions _for_every_case_
 or not.


 --
 Gaurav Menghani

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Why this is giving run time error ?

2011-08-04 Thread Tushar Kanta Rath
@Dipankar : thanks.i think,this is the right logic

On Thu, Aug 4, 2011 at 11:10 AM, Dipankar Patro dip10c...@gmail.com wrote:

 Well I think the reason is very simple:
 When you enter the loop through L, the value of i is not initialized to 0,
 it is some garbage value.
 now while exiting the loop, the condition is checked for another iteration.
 Since the value of i is unknown, it might be the case that ij for a lot of
 number of times before the loop actually ends.

 But it is not a runtime error, and no infinite loop. the loop will end, the
 moment value of i becomes = j.

 On 4 August 2011 11:00, TUSHAR tusharkanta.r...@gmail.com wrote:

 #includestdio.h
 main()
 {
  int j=4,i;
  goto L;
  for(i=0;ij;i++)
  {

   L:
 printf(%d,j);
   }
 }




 why this is giving infinite loop.Runtime error ?



 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Tushar Kanta Rath,
Master In Computer Application
MNNIT, Allahabad

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Gaurav Menghani
On Thu, Aug 4, 2011 at 8:13 PM, saurabh singh saurab...@gmail.com wrote:

  think its NP complete once the number of teams become varaible,
 corrct me if wrong i am weak with the theoritical stuffs...


Err, it is NP-complete, the thing is when the set of integers is small, a DP
solution runs in reasonable time. When you increase the set size, the time
taken increases.

-- 
Gaurav Menghani
Stony Brook University

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Dipankar Patro
Kashish,
I think it won't work.

The correct is:
ls -R | grep .java

On 4 August 2011 20:17, kashish jain kashish.jain.n...@gmail.com wrote:

 answer to shell command is
 grep -r *.java

 i wanted to ask , am i right ?


 On Thu, Aug 4, 2011 at 2:16 PM, Shashank Jain shashan...@gmail.comwrote:

 whats the priority of ^ symbol?

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 1:52 PM, Arun Vishwanathan aaron.nar...@gmail.com
  wrote:

 there are 12 black and 12 white socks
 p(bb)+p(ww) is what we want...

 p(bb)=12/24*11/23
 p(ww)=12/24*11/23

 so it is just 2*12/24*11/23=11/23

 On Wed, Aug 3, 2011 at 9:08 PM, Prakash D cegprak...@gmail.com wrote:

 no.. it's really easy to find it out

 there are 12 black and 12 white pieces.

 let black =1  and white =0

 the possible results are 11, 00, 10, 01


 number of ways of 11 solutions=  12 * 11 =  132
 number of ways of 00 solutions = 12 * 11 = 132
 number of ways of 10 solutions = 12 * 12 = 144
 number of ways of 01 solutions = 12 * 12 = 144


 we need the prob of 10 + prob 01 ==  (144+144)/(132+ 132 + 144 + 144)

 =288/552 =  36/69 = 12/23

 I think 11/23 is wrong




 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] OS question

2011-08-04 Thread ankit sambyal
What happens when a thread calls exec ?? What happens to the other threads
of the same process ??

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread saurabh singh
ls -R *.java

On Thu, Aug 4, 2011 at 8:26 PM, Dipankar Patro dip10c...@gmail.com wrote:

 Kashish,
 I think it won't work.

 The correct is:
 ls -R | grep .java

 On 4 August 2011 20:17, kashish jain kashish.jain.n...@gmail.com wrote:

 answer to shell command is
 grep -r *.java

 i wanted to ask , am i right ?


 On Thu, Aug 4, 2011 at 2:16 PM, Shashank Jain shashan...@gmail.comwrote:

 whats the priority of ^ symbol?

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 1:52 PM, Arun Vishwanathan 
 aaron.nar...@gmail.com wrote:

 there are 12 black and 12 white socks
 p(bb)+p(ww) is what we want...

 p(bb)=12/24*11/23
 p(ww)=12/24*11/23

 so it is just 2*12/24*11/23=11/23

 On Wed, Aug 3, 2011 at 9:08 PM, Prakash D cegprak...@gmail.com wrote:

 no.. it's really easy to find it out

 there are 12 black and 12 white pieces.

 let black =1  and white =0

 the possible results are 11, 00, 10, 01


 number of ways of 11 solutions=  12 * 11 =  132
 number of ways of 00 solutions = 12 * 11 = 132
 number of ways of 10 solutions = 12 * 12 = 144
 number of ways of 01 solutions = 12 * 12 = 144


 we need the prob of 10 + prob 01 ==  (144+144)/(132+ 132 + 144 + 144)

 =288/552 =  36/69 = 12/23

 I think 11/23 is wrong




 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] OS question

2011-08-04 Thread Dipankar Patro
I think the answer would be the thread calling execute will have to wait for
the executed command to exit and then it will proceed.
As for other threads, they shouldn't be affected.

Please do correct me if it is wrong.

On 4 August 2011 20:27, ankit sambyal ankitsamb...@gmail.com wrote:

 What happens when a thread calls exec ?? What happens to the other threads
 of the same process ??

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Why this is giving run time error ?

2011-08-04 Thread Dipankar Patro
You are welcome Tushar.
My suggestion is always to print the value of iter (i in this case) in a
loop if you think there is something wrong. Helps 99% of times.

On 4 August 2011 20:13, Tushar Kanta Rath tusharkanta.r...@gmail.comwrote:

 @Dipankar : thanks.i think,this is the right logic

 On Thu, Aug 4, 2011 at 11:10 AM, Dipankar Patro dip10c...@gmail.comwrote:

 Well I think the reason is very simple:
 When you enter the loop through L, the value of i is not initialized to 0,
 it is some garbage value.
 now while exiting the loop, the condition is checked for another
 iteration. Since the value of i is unknown, it might be the case that ij
 for a lot of number of times before the loop actually ends.

 But it is not a runtime error, and no infinite loop. the loop will end,
 the moment value of i becomes = j.

 On 4 August 2011 11:00, TUSHAR tusharkanta.r...@gmail.com wrote:

 #includestdio.h
 main()
 {
  int j=4,i;
  goto L;
  for(i=0;ij;i++)
  {

   L:
 printf(%d,j);
   }
 }




 why this is giving infinite loop.Runtime error ?



 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 ___

 Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Tushar Kanta Rath,
 Master In Computer Application
 MNNIT, Allahabad




   --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
___

Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Pointers

2011-08-04 Thread abhishek kumar
i think for 
pointers:- yashwant kanetkar(Understanding pointers in C) will be good 
enough.
Queues, Stacks: Tanenbaum(Data Structures through C/C++) 

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/B464lUDHmasJ.
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.



[algogeeks] pointer question

2011-08-04 Thread Vijay Khandar
#includestdio.h
#includeconio.h
void main()
{
clrscr();
float a=5.375;
char *p;
int i;
p=(char *)a;
for(i=0;i=3;i++)
printf(%02x,(unsigned char)p[i]);
getch();
}

O/P-00 00 AC 40
Plz anyone explain me output.
Vijay

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] OS question

2011-08-04 Thread ankit sambyal
@Dipankar: But all the threads of a process share code and data section. So,
how is it possible that they are not affected ???

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Poised~
@ Muthu raj:
My bad, didn't check it properly. It is surely a runtime error.

@ Niteesh Mehra:
That code is even more wrong.
without assigning any memory to str, how will you copy anything into it?
This will definitely be a runtime error.
http://ideone.com/erEXf

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/NrO6EJiurBkJ.
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.



Re: [algogeeks] OS question

2011-08-04 Thread Poised~
Good point.
Let me search a bit on Threads. Will get back asap.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/7pWIqcdwugcJ.
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.



[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Poised~
+1 to 11/23 in probability question

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/IVQqcq_D5RsJ.
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.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread Amol Sharma
original knapsack is called fractional knapsack in which greedy works...but
we were talking abt 0-1 knapsack :P
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Thu, Aug 4, 2011 at 8:19 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:



 On Thu, Aug 4, 2011 at 8:13 PM, saurabh singh saurab...@gmail.com wrote:

  think its NP complete once the number of teams become varaible,
 corrct me if wrong i am weak with the theoritical stuffs...


 Err, it is NP-complete, the thing is when the set of integers is small, a
 DP solution runs in reasonable time. When you increase the set size, the
 time taken increases.

 --
 Gaurav Menghani
 Stony Brook University

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread Aditya Virmani
thiis is theexact thing i thought abt segmentation error...but it is again
system-dependent...if u wud try this on 7 or vista or XP...which are high
on resources it wont give error to that...but there is definately an error
in code...
but y do u think tht junk wont be overwritten? s is simply a pointer to a
memory address...contents can be changed whenever reqd...?

On Thu, Aug 4, 2011 at 8:51 PM, Poised~ dip10c...@gmail.com wrote:

 @ Muthu raj:
 My bad, didn't check it properly. It is surely a runtime error.

 @ Niteesh Mehra:
 That code is even more wrong.
 without assigning any memory to str, how will you copy anything into it?
 This will definitely be a runtime error.
 http://ideone.com/erEXf

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/NrO6EJiurBkJ.

 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Tug of War

2011-08-04 Thread saurabh singh
I told you the spirit is greedy backed up by DP for creating correct optimal
substructuresA pure greedy solution wont create the right
substructure...

On Thu, Aug 4, 2011 at 9:06 PM, Amol Sharma amolsharm...@gmail.com wrote:

 original knapsack is called fractional knapsack in which greedy works...but
 we were talking abt 0-1 knapsack :P

 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Thu, Aug 4, 2011 at 8:19 PM, Gaurav Menghani gaurav.mengh...@gmail.com
  wrote:



 On Thu, Aug 4, 2011 at 8:13 PM, saurabh singh saurab...@gmail.comwrote:

  think its NP complete once the number of teams become varaible,
 corrct me if wrong i am weak with the theoritical stuffs...


 Err, it is NP-complete, the thing is when the set of integers is small, a
 DP solution runs in reasonable time. When you increase the set size, the
 time taken increases.

 --
 Gaurav Menghani
 Stony Brook University

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread wastrel
the thing wrong with 1 is it doesnt return any value...main if not 
explicitly declared is of type int  hence main shud return some value...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/uRfNdbCCJ7oJ.
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.



Re: [algogeeks] max product of a subarray

2011-08-04 Thread Thayumanavar S
 given an array containing +ve n -ve numbers , can someone give
 efficient algo to find the max cont subarray product.

this is same as problem http://online-judge.uva.es/p/v110/11059.html.
here is the code for this one:
#include cstdio
#include iostream
#include algorithm
#include limits.h
using namespace std;
/* Algorithm:
1. if there is no zero in the array, the number of negative
number is even,
   max product would be product of all numbers.
2. so we partition array around zero points and calculate each
subarray max product
   and max product would be the subarray which has max value among this.
3. if in the subarray, the number of negative number is odd,
then we need to leave out
   -ve number either on left or right depending on which has
lesser absolute value.
*/

long long int
submaxproduct(int *a, int start, int end);
long long int
maxprod(int *a, int n)
{

long long int maxprod = INT_MIN;
long long int maxarrprod = 0;
int start=0,i;
if ( a == NULL ||  n == 0 ) return 0;
for ( i = 0; i  n; i++ ) {
if ( a[i] == 0 ) {
if ( i != 0  a[i-1] != 0 ) { maxarrprod =
submaxproduct(a, start, i-1);
if ( maxarrprod  maxprod )
maxprod = maxarrprod; }
start = i+1;
}
else if ( i == n-1 ) {
maxarrprod = submaxproduct(a, start, i);
if ( maxarrprod  maxprod )
maxprod = maxarrprod;
}
}
if ( maxprod  0 ) maxprod = 0;
return maxprod;
}
long long int
submaxproduct(int *a, int start, int end)
{
int lprod=1,rprod=1;
int lneg=0,rneg=0;
long long int mprod=1;
int count=0;
int i;
for ( i = start; i=end;i++ )
{
mprod *= a[i];
if ( a[i]  0  lneg == 0 )
lprod *= a[i];
else if ( a[i]0  rneg != 0 )
rprod *= a[i];
else if ( a[i]  0  lneg != 0 ) {
count++;
rneg = a[i];
rprod = 1;
}
else if ( a[i]  0 ) {
count++;
lneg = rneg = a[i];
}
}
if ( ( count  0  (end-start) == 0) || count%2 == 0 )
return mprod;
else {
long long int maxf = max(rneg*rprod,lneg*lprod);
return mprod/maxf;
}
}
int
main()
{
int n;
int count = 1;
int i;
while ( cinn ) {
int a[n];
for ( i = 0; i  n; i++ ) {
cin a[i];
}
printf(Case #%d: The maximum product is
%lld.,count++,maxprod(a,n));
printf(\n\n);
}

return 0;
}


thayumanavar s

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Pointers

2011-08-04 Thread arvind kumar
okay,thanks a lot:)

On Thu, Aug 4, 2011 at 8:46 PM, abhishek kumar 
mailatabhishekgu...@gmail.com wrote:

 i think for
 pointers:- yashwant kanetkar(Understanding pointers in C) will be good
 enough.
 Queues, Stacks: Tanenbaum(Data Structures through C/C++)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/B464lUDHmasJ.

 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: pointer question

2011-08-04 Thread wastrel
floating point numbers are stored in 4 bytes with first 3 bytes storing the 
mantissa part...1st bit of last byte stores the sign of mantissa... rest of 
the bits store the magnitude of the exponent relative to +127( exponent + 
127 wll be stored). Now ur num will be stored as 5375 in first 3 bytes  130 
in last 7 bits of 7 byte...calculate for urself the bit representation...
x in printing signifies printing in hexadecimal format...2 signifies no more 
than 2 hexadecimal numbers wud be printed...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/JjIHYsEXmXcJ.
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.



[algogeeks] Re: Puzzle

2011-08-04 Thread Dave
@Aditi: The ropes burn at non-uniform rates. So for your solution, you
would have to fold it in half according to time, not according to
length. But you don't know where the half-hour point is unless you
light one end of the second rope at the same time you light both ends
of the first rope. When the first rope burns out, you will know where
the half-hour point is on the second rope.

Dave

On Aug 4, 7:47 am, aditi garg aditi.garg.6...@gmail.com wrote:
 Well acc to me the solution should be light the frst one on both ends(half
 an hr)After rope one is completely burnt, fr the second one fold the rope in
 the middle and then light it from both ends.it will take 15 minstotal 45
 mins...please let me know if thr is any flaw in this

 On Thu, Aug 4, 2011 at 5:18 PM, Abhinav Arora 
 abhinavdgr8b...@gmail.comwrote:

  @Nikhil : This question was asked to 2 people during Adobe interview on
  Tuesdaythe above solutions are perfectly alright.

  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/Bx9FHS_7aRMJ.

  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.

 --
 Aditi Garg
 Undergraduate Student
 Electronics  Communication Divison
 NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
 Sector 3, Dwarka
 New 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 this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Tug of War

2011-08-04 Thread Don
As some have said, this is NP, so for larger values of N it takes a
very long time. For N=20 it runs quite quickly.



// True if some set of strengths from s[n] sum to t
bool divide(unsigned int *s, int n, int t)
{
if (t == 0) return true; // We reached the goal
if (n == 0) return false;// No people left to assign
if (*s  t) return false;// Smallest person exceeds goal
if (*s * n  t) return false;// Everyone else can not total
to goal
if (divide(s+1,n-1,t)) return true;  // Consider not including first
person in line
return divide(s+1,n-1,t-*s); // Consider including first
person in line
}

int main(int argc, char* argv[])
{
const int MAX=50;
int N;
unsigned int strength[MAX];
int sum = 0;
int i,j;

printf(How many people are playing?);
scanf(%d,N);
for(i = 0; i  N; ++i)
{
printf(Enter strength of person %d:, i+1);
scanf(%d, strength[i]);
sum += strength[i];
}

if (sum % 2 == 1)
{
printf(NO\n);
}
else
{
// Sort from high to low
for(i = 0; i  N; ++i)
for(j = 1; j  N; ++j)
{
if (strength[j]  strength[j-1])
{
strength[j] ^= strength[j-1];
strength[j-1] ^= strength[j];
strength[j] ^= strength[j-1];
}
}

if (divide(strength+1,N-1,sum/2)) printf(YES\n);
else printf(NO\n);
}

return 0;
}

On Jul 30, 4:44 am, sylvester abeygau...@gmail.com wrote:
 input  consists of N integers, separated by a space. The ith integer
 indicates the strength of the ith person.
 For each case, output YES if it is possible to pick some people from
 the group and separate into two teams of equal strengths else NO

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] OS question

2011-08-04 Thread Azhar Hussain
To elaborate more. New process image will not have the existing threads and
user defined data declared in current process will be wiped out. Parent can
do is to wait for the child status by calling wait().
for example
main()
{
 pid = fork();
if (child) {
exec(ls);   /// here 'ls' will replace the child process
no matter how many threads it has
   }
   else // parent
wait for child

}

-
Azhar.

On Thu, Aug 4, 2011 at 9:50 PM, Azhar Hussain azhar...@gmail.com wrote:

 The *exec* family of functions shall replace the current process image
 with a new process image. It does not matter how many threads you have
 whole process gets replaced with new one.


 -
 Azhar.


 On Thu, Aug 4, 2011 at 8:27 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 What happens when a thread calls exec ?? What happens to the other threads
 of the same process ??

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Puzzle

2011-08-04 Thread aditi garg
@dave...im not burning half of the rope or anything...my idea is jst to
increase the rate of burning..by folding it in the middle and then lighting
it from both ends...im burning the entire rope wid 4 times the rate of
burning...shud take 15 mins

On Thu, Aug 4, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote:

 @Aditi: The ropes burn at non-uniform rates. So for your solution, you
 would have to fold it in half according to time, not according to
 length. But you don't know where the half-hour point is unless you
 light one end of the second rope at the same time you light both ends
 of the first rope. When the first rope burns out, you will know where
 the half-hour point is on the second rope.

 Dave

 On Aug 4, 7:47 am, aditi garg aditi.garg.6...@gmail.com wrote:
  Well acc to me the solution should be light the frst one on both
 ends(half
  an hr)After rope one is completely burnt, fr the second one fold the rope
 in
  the middle and then light it from both ends.it will take 15
 minstotal 45
  mins...please let me know if thr is any flaw in this
 
  On Thu, Aug 4, 2011 at 5:18 PM, Abhinav Arora abhinavdgr8b...@gmail.com
 wrote:
 
   @Nikhil : This question was asked to 2 people during Adobe interview on
   Tuesdaythe above solutions are perfectly alright.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To view this discussion on the web visit
  https://groups.google.com/d/msg/algogeeks/-/Bx9FHS_7aRMJ.
 
   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.
 
  --
  Aditi Garg
  Undergraduate Student
  Electronics  Communication Divison
  NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
  Sector 3, Dwarka
  New 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 this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Aditi Garg
Undergraduate Student
Electronics  Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New 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 this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Fwd: Solve dis!

2011-08-04 Thread jestincobol nair
guys even i m not sure cindy or linda but either of dem is corrrect

On Thu, Aug 4, 2011 at 7:07 PM, priya v pria@gmail.com wrote:

 I got this as my answer-
 First place- Cindy or Linda
 Second Place- C or L or A
 Third place- C or A
 How is it possible to eliminate any other possibility. Any condition
 missing?


 On Thu, Aug 4, 2011 at 7:02 PM, mithun bs mithun...@gmail.com wrote:

 Arvind,
 By which condition are you eliminating Linda?


 On Thu, Aug 4, 2011 at 6:59 PM, arvind kumar arvindk...@gmail.comwrote:

 Cos Linda and Amy are eliminated jus by seein d given conditions


 On Thu, Aug 4, 2011 at 6:57 PM, priya v pria@gmail.com wrote:

 How is the answer for the first q cindy?

 On Thu, Aug 4, 2011 at 5:59 PM, jestincobol nair jestinco...@gmail.com
  wrote:

 @shady : logic for selecting cindy ??
   And yes Tuesday is obvious :)


 On Thu, Aug 4, 2011 at 5:47 PM, mithun bs mithun...@gmail.com wrote:

 Ya, Tuesday is right. Quiet simple

 On Sunday both should say truth. If only one guy says it is sunday it
 should be a lie.
 So the answer should be Tuesday only.


 On Thu, Aug 4, 2011 at 5:24 PM, sagar pareek 
 sagarpar...@gmail.comwrote:

 @shady why cindy not linda?


 On Thu, Aug 4, 2011 at 5:21 PM, shady sinv...@gmail.com wrote:

 ^ it is cindy
 1-cindy
 2-linda
 3-amy


 On Thu, Aug 4, 2011 at 5:18 PM, sagar pareek sagarpar...@gmail.com
  wrote:

 1. i am not sure abt cindy or linda...

 2. tuesday


 On Thu, Aug 4, 2011 at 4:41 PM, jestincobol nair 
 jestinco...@gmail.com wrote:



 -- Forwarded message --
 From: jestincobol nair jestinco...@gmail.com
 Date: Thu, Aug 4, 2011 at 4:33 PM
 Subject: Solve dis!



 *Three beauty pageant finalists-Cindy, Amy and Linda-The winner
 was musician. The one who was not last or first was a math major. 
 The one
 who came in third had black hair. Linda had red hair. Amy had no 
 musical
 abilities. Who was first?*

 (A) Cindy (B) Amy (C) Linda (D) None of these

 *Two twins have certain peculiar characteristics. One of them
 always lies on Monday, Wednesday, Friday. The other always lies on 
 Tuesdays,
 Thursday and Saturdays. On the other days they tell the truth. You 
 are given
 a conversation.
 Person A- today is Sunday, my name is Anil
 Person B-today is Tuesday, my name is Bill What day is today?*

 (A) Sunday (B) Tuesday (C) Monday (D) Thursday

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 **Regards
 SAGAR PAREEK
 COMPUTER SCIENCE AND ENGINEERING
 NIT ALLAHABAD

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Mithun.B.S
 M:9916775380

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 

Re: [algogeeks] OS question

2011-08-04 Thread Azhar Hussain
The *exec* family of functions shall replace the current process image with
a new process image. It does not matter how many threads you have whole
process gets replaced with new one.


-
Azhar.

On Thu, Aug 4, 2011 at 8:27 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 What happens when a thread calls exec ?? What happens to the other threads
 of the same process ??

 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: pointer question

2011-08-04 Thread Vijay Khandar
Thanks, but can u elaborate some more explanation, that how for loop is
working here

Vijay

On Thu, Aug 4, 2011 at 9:52 PM, wastrel virmanisadi...@gmail.com wrote:

 floating point numbers are stored in 4 bytes with first 3 bytes storing the
 mantissa part...1st bit of last byte stores the sign of mantissa... rest of
 the bits store the magnitude of the exponent relative to +127( exponent +
 127 wll be stored). Now ur num will be stored as 5375 in first 3 bytes  130
 in last 7 bits of 7 byte...calculate for urself the bit representation...
 x in printing signifies printing in hexadecimal format...2 signifies no
 more than 2 hexadecimal numbers wud be printed...

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/JjIHYsEXmXcJ.
 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.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] OS question

2011-08-04 Thread ankit sambyal
Thnks Azhar :)
got the point

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Nitin Nizhawan
find ./  -name *.java

On Thu, Aug 4, 2011 at 8:17 PM, kashish jain kashish.jain.n...@gmail.comwrote:

 answer to shell command is
 grep -r *.java

 i wanted to ask , am i right ?


 On Thu, Aug 4, 2011 at 2:16 PM, Shashank Jain shashan...@gmail.comwrote:

 whats the priority of ^ symbol?

 Shashank Jain
 IIIrd year
 Computer Engineering
 Delhi College of Engineering



 On Thu, Aug 4, 2011 at 1:52 PM, Arun Vishwanathan aaron.nar...@gmail.com
  wrote:

 there are 12 black and 12 white socks
 p(bb)+p(ww) is what we want...

 p(bb)=12/24*11/23
 p(ww)=12/24*11/23

 so it is just 2*12/24*11/23=11/23

 On Wed, Aug 3, 2011 at 9:08 PM, Prakash D cegprak...@gmail.com wrote:

 no.. it's really easy to find it out

 there are 12 black and 12 white pieces.

 let black =1  and white =0

 the possible results are 11, 00, 10, 01


 number of ways of 11 solutions=  12 * 11 =  132
 number of ways of 00 solutions = 12 * 11 = 132
 number of ways of 10 solutions = 12 * 12 = 144
 number of ways of 01 solutions = 12 * 12 = 144


 we need the prob of 10 + prob 01 ==  (144+144)/(132+ 132 + 144 + 144)

 =288/552 =  36/69 = 12/23

 I think 11/23 is wrong




 --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.




  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



  1   2   3   >