Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-06 Thread Tushar Bindal
is it confirmed that the answer is 11/23 only?
bcoz the point that we need a left-right pair only is also valid. if we
consider that case, answer comes out to be 12/23.
since it just says pair, shall we assume that pair means just 2 of same
colour or take a proper pair that consists of one right and one left



On Fri, Aug 5, 2011 at 9:46 AM, sukran dhawan sukrandha...@gmail.comwrote:

 cpp = cp is valid.other one is not valid because the compiler places cp in
 read only memory.so we cannot change its address


 On Fri, Aug 5, 2011 at 12:43 AM, Ankur Khurana 
 ankur.kkhur...@gmail.comwrote:

 dev cpp par chal jaenge ,
 ideone.com par try kar
 cp=cpp nahi chalega . .


 On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i have a doubt regarding 3rd questions..acc to me both are valid...what
 is the correct answer?


 On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

 2 issues:
 1. no error handling for malloc failure( can be ignored)
 2. no memset for pq.

 strcat will not work properly: as by definition it will search for the
 null char in first string, removes it then copies the second string
 including the null char of second string.

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 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.




-- 
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.



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.



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: 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.



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.



[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.



[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] 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.



[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread newOne
2 issues:
1. no error handling for malloc failure( can be ignored)
2. no memset for pq.

strcat will not work properly: as by definition it will search for the
null char in first string, removes it then copies the second string
including the null char of second string.

-- 
You received this message 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 Kamakshii Aggarwal
i have a doubt regarding 3rd questions..acc to me both are valid...what is
the correct answer?

On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

 2 issues:
 1. no error handling for malloc failure( can be ignored)
 2. no memset for pq.

 strcat will not work properly: as by definition it will search for the
 null char in first string, removes it then copies the second string
 including the null char of second string.

 --
 You received this message 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,
Kamakshi
kamakshi...@gmail.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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Ankur Khurana
dev cpp par chal jaenge ,
ideone.com par try kar
cp=cpp nahi chalega . .

On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i have a doubt regarding 3rd questions..acc to me both are valid...what is
 the correct answer?


 On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

 2 issues:
 1. no error handling for malloc failure( can be ignored)
 2. no memset for pq.

 strcat will not work properly: as by definition it will search for the
 null char in first string, removes it then copies the second string
 including the null char of second string.

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




-- 
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 sukran dhawan
@muthuraj yes he is right

On Wed, Aug 3, 2011 at 10:42 PM, muthu raj muthura...@gmail.com wrote:

 5)
 Sample space=24C2= 276
 N(S) = 12 C 2 + 12 C 2 =132

 Probability= 132/276= 11/23


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




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

 assume there are 6 1's and 6 0's

 if two are selected together randomly%
 the possible outcomes are 00, 11, 01, 10

 00- 30 possibilities
 11 - 30 possibilities

 10 - 36 possibilities
 01 - 36 possibilities


 probability of 10  or 01 =  (36+36)/(30+30+36+36)

 =18/31

  is it one of the options?


 On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong
 ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.comwrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

  --
 You received this message 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.



[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread vetri
it's working fine on both dev and ideone.com

On Aug 5, 12:13 am, Ankur Khurana ankur.kkhur...@gmail.com wrote:
 dev cpp par chal jaenge ,
 ideone.com par try kar
 cp=cpp nahi chalega . .

 On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal
 kamakshi...@gmail.comwrote:









  i have a doubt regarding 3rd questions..acc to me both are valid...what is
  the correct answer?

  On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

  2 issues:
  1. no error handling for malloc failure( can be ignored)
  2. no memset for pq.

  strcat will not work properly: as by definition it will search for the
  null char in first string, removes it then copies the second string
  including the null char of second string.

  --
  You received this message 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,
  Kamakshi
  kamakshi...@gmail.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.

 --
 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 sukran dhawan
cpp = cp is valid.other one is not valid because the compiler places cp in
read only memory.so we cannot change its address

On Fri, Aug 5, 2011 at 12:43 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:

 dev cpp par chal jaenge ,
 ideone.com par try kar
 cp=cpp nahi chalega . .


 On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 i have a doubt regarding 3rd questions..acc to me both are valid...what is
 the correct answer?


 On Fri, Aug 5, 2011 at 12:27 AM, newOne trader.lu...@gmail.com wrote:

 2 issues:
 1. no error handling for malloc failure( can be ignored)
 2. no memset for pq.

 strcat will not work properly: as by definition it will search for the
 null char in first string, removes it then copies the second string
 including the null char of second string.

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 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.



[algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread cegprakash
2 is pretty easy..

3: both

5: 6/12 * 6/11  = 3/11

am i right?

-- 
You received this message 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-03 Thread Kamakshii Aggarwal
i think dere is nothing wrong in ques 1.is there any error?

On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
Kamakshi
kamakshi...@gmail.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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread JAIDEV YADAV
there is no error in first question ... u thik so.. correct me if wrong ...

On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




-- 
JaiDev Yadav
(National Yoga Champion)
Computer Engg. Dept.
National Institute of Technology
Kurukshetra,Haryana

-- 
You received this message 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-03 Thread Kamakshii Aggarwal
i think answer for 5th should be 11/23. Am i right?


On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.com




-- 
Regards,
Kamakshi
kamakshi...@gmail.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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread saurabh singh
answer for 5th according to me is 6/12*5/11+6/12*5/11

On Wed, Aug 3, 2011 at 10:31 PM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:

 i think answer for 5th should be 11/23. Am i right?


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.com




 --
 Regards,
 Kamakshi
 kamakshi...@gmail.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.




-- 
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] Re: Amazon Aptitude questions

2011-08-03 Thread Prakash D
assume there are 6 1's and 6 0's

if two are selected together randomly
the possible outcomes are 00, 11, 01, 10

00- 30 possibilities
11 - 30 possibilities

10 - 36 possibilities
01 - 36 possibilities


probability of 10  or 01 =  (36+36)/(30+30+36+36)

=18/31

 is it one of the options?


On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal kamakshi...@gmail.com
  wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

  --
 You received this message 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: Amazon Aptitude questions

2011-08-03 Thread muthu raj
5)
Sample space=24C2= 276
N(S) = 12 C 2 + 12 C 2 =132

Probability= 132/276= 11/23


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



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

 assume there are 6 1's and 6 0's

 if two are selected together randomly%
 the possible outcomes are 00, 11, 01, 10

 00- 30 possibilities
 11 - 30 possibilities

 10 - 36 possibilities
 01 - 36 possibilities


 probability of 10  or 01 =  (36+36)/(30+30+36+36)

 =18/31

  is it one of the options?


 On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong
 ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

  --
 You received this message 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.



[algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Dave
@Kamakshii: Yes. 11/23 is correct. Whatever the color of the first
sock chosen, there are 11 mates in the 23 remaining socks.

Dave

On Aug 3, 12:01 pm, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
 i think answer for 5th should be 11/23. Am i right?

 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal
 kamakshi...@gmail.comwrote:





  i think dere is nothing wrong in ques 1.is there any error?

  On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com wrote:

  2 is pretty easy..

  3: both

  5: 6/12 * 6/11  = 3/11

  am i right?

  --
  You received this message 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,
  Kamakshi
  kamakshi...@gmail.com

 --
 Regards,
 Kamakshi
 kamakshi...@gmail.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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Sandeep Jain
1) p  q can be checked for null i.e. to handle the condition when malloc
fails, otherwise I don't see any thing wrong in it.

3) Only cppp=cp is valid. because any pointer to some const type can be
assigned pointer to a non-const type but not vice versa.

4) Different for different OS, on Windows you can use DIR /S *.java

5) 2 *((12/24)*(11/23)) = 11/23


Regards,
Sandeep Jain



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

 @Kamakshii: Yes. 11/23 is correct. Whatever the color of the first
 sock chosen, there are 11 mates in the 23 remaining socks.

 Dave

 On Aug 3, 12:01 pm, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
  i think answer for 5th should be 11/23. Am i right?
 
  On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal
  kamakshi...@gmail.comwrote:
 
 
 
 
 
   i think dere is nothing wrong in ques 1.is there any error?
 
   On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.com
 wrote:
 
   2 is pretty easy..
 
   3: both
 
   5: 6/12 * 6/11  = 3/11
 
   am i right?
 
   --
   You received this message 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,
   Kamakshi
   kamakshi...@gmail.com
 
  --
  Regards,
  Kamakshi
  kamakshi...@gmail.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.



-- 
You received this message 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-03 Thread Prakash D
18/33?

On Wed, Aug 3, 2011 at 10:42 PM, muthu raj muthura...@gmail.com wrote:

 5)
 Sample space=24C2= 276
 N(S) = 12 C 2 + 12 C 2 =132

 Probability= 132/276= 11/23


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



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

 assume there are 6 1's and 6 0's

 if two are selected together randomly%
 the possible outcomes are 00, 11, 01, 10

 00- 30 possibilities
 11 - 30 possibilities

 10 - 36 possibilities
 01 - 36 possibilities


 probability of 10  or 01 =  (36+36)/(30+30+36+36)

 =18/31

  is it one of the options?


 On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong
 ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.comwrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

  --
 You received this message 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] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
prakash its 11/23 only

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

 18/33?


 On Wed, Aug 3, 2011 at 10:42 PM, muthu raj muthura...@gmail.com wrote:

 5)
 Sample space=24C2= 276
 N(S) = 12 C 2 + 12 C 2 =132

 Probability= 132/276= 11/23


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



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

 assume there are 6 1's and 6 0's

 if two are selected together randomly%
 the possible outcomes are 00, 11, 01, 10

 00- 30 possibilities
 11 - 30 possibilities

 10 - 36 possibilities
 01 - 36 possibilities


 probability of 10  or 01 =  (36+36)/(30+30+36+36)

 =18/31

  is it one of the options?


 On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV jaid...@gmail.com wrote:

 there is no error in first question ... u thik so.. correct me if wrong
 ...


 On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal 
 kamakshi...@gmail.com wrote:

 i think dere is nothing wrong in ques 1.is there any error?


 On Wed, Aug 3, 2011 at 9:46 PM, cegprakash cegprak...@gmail.comwrote:

 2 is pretty easy..

 3: both

 5: 6/12 * 6/11  = 3/11

 am i right?

 --
 You received this message 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,
 Kamakshi
 kamakshi...@gmail.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.




 --
 JaiDev Yadav
 (National Yoga Champion)
 Computer Engg. Dept.
 National Institute of Technology
 Kurukshetra,Haryana

  --
 You received this message 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.




-- 
Regards,
Kamakshi
kamakshi...@gmail.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.



Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Prakash D
i din't look at the word pair :P.. sorry

-- 
You received this message 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-03 Thread ankit sambyal
for question 3:
cpp=cp is the correct answer. Can anybody explain ?

-- 
You received this message 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-03 Thread The Mad Hatter
there's nothing definitely wrong with 1. but if I was about to make a peer 
review I'd complain about two things: i) if this is pure-C then you should 
not cast malloc's return, it's pointless and error prone --- since malloc 
returns void* and by casting you get nothing but coupled code which is not 
desirable and ii) of course it's even minor issues but you could check the 
bounds before copying stuff,, it's ok when you know that amazon+hyd is less 
than 25 bytes but checking won't do no harm so it's advisable.

again, these are really minor points. since it's a question it deserves the 
best answer possible. I don't see anything else in the code.

-- 
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/-/a8W_52g2-EQJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-03 Thread JAIDEV YADAV
2*(12/24)*(6/23)
I suppose the pair of socks would be a left-right foot combination
separately an not the same for both the feet
Sample Space is 6 in that case (2nd chance)

On Wed, Aug 3, 2011 at 11:06 PM, ankit sambyal ankitsamb...@gmail.comwrote:

 for question 3:
 cpp=cp is the correct answer. Can anybody explain ?

  --
 You received this message 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.




-- 
JaiDev Yadav
(National Yoga Champion)
Computer Engg. Dept.
National Institute of Technology
Kurukshetra,Haryana

-- 
You received this message 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-03 Thread Prakash D
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.