Re: [algogeeks] Interview Puzzle - 100 Prisoners and Caps

2011-07-22 Thread chetan kapoor
josehus problem???

On Fri, Jul 22, 2011 at 7:57 PM, Pankaj  wrote:

> Skipp Riddle,
> Yes.
> 100th prisoner will risk his life. Similar puzzle was discuss recently.
> Does anyone remember the name or thread?
>
>
> ~
> Pankaj
>
>
> On Fri, Jul 22, 2011 at 7:55 PM, SkRiPt KiDdIe wrote:
>
>> Worst case 99 get released.
>> Is that correct..?
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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: Shooters in a circle

2011-07-21 Thread chetan kapoor
yeah u r wrong...the question says the person will kill the person standing
next to its neighbor..

On Thu, Jul 21, 2011 at 4:16 PM, SAMMM  wrote:

> Consider this Example:-
>
>
>
>  1 2 3 4 5 6 7 1 In CIrcle 
>
>  1 kills 2
>  3 kills 4
>  5 kills 6
>  7 kills 1
>
> Remaining ppl :- 3 5 7
>
> 3 kills 5
> 7 kills 3
>
> Remain-> 7
>
>
> This  is the sequence .. i guess   Isit
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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: C output

2011-07-20 Thread chetan
its showing same output...

On Jul 20, 6:40 pm, chetan kapoor  wrote:
> but its showing output
>
>
>
>
>
>
>
> On Wed, Jul 20, 2011 at 6:53 PM, mohit verma  wrote:
> > hey guys...
>
> > 1. char c='a';
>
> >   while(c=='a')
> > {
> >  printf("%c",c);
> > c=getchar();
> > }
>
> > ..
> > 2.
> >   char c='a';
> > while(c!='b')
> > {
> >   printf("%c",c);
> > c=getchar();
> > }
>
> > 
> > why does printf()  show different outputs for these two different loops.
>
> > --
> > 
> > *MOHIT VERMA*
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from 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] C output

2011-07-20 Thread chetan kapoor
but its showing output

On Wed, Jul 20, 2011 at 6:53 PM, mohit verma  wrote:

> hey guys...
>
> 1. char c='a';
>
>   while(c=='a')
> {
>  printf("%c",c);
> c=getchar();
> }
>
> ..
> 2.
>   char c='a';
> while(c!='b')
> {
>   printf("%c",c);
> c=getchar();
> }
>
> 
> why does printf()  show different outputs for these two different loops.
>
> --
> 
> *MOHIT VERMA*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] Download Full Movies Hot Type +18

2010-07-05 Thread chetan thorat
Shame on u man..


On 4 July 2010 21:48,   wrote:
> Download Full Movies  Hot Type +18
>
> http://bit.ly/cWhJJk
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from 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 algoge...@googlegroups.com.
To unsubscribe from 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] c output

2010-06-11 Thread chetan thorat
The return value of printf is the number of characters it prints successfully.
So the rightmost printf is going to return 2 (one for char c and one
for new line), similarly second one returning 6.

Regards,
Chetan.


On 11 June 2010 00:56, divya  wrote:
> #include 
> main()
> {
>  int a = 1;
>  char b='c';
>  int i,j;
>
>  printf("%d,%d",printf("%d\n",a),printf("%c\n",b));
>
> wat shd b the o/p of this..plzz explain y?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from 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 algoge...@googlegroups.com.
To unsubscribe from 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: probabiltiy + DP

2009-09-24 Thread chetan thorat

On 23/09/2009, vicky  wrote:
>
> @ Minjie Zha ,
> hey, how does these things clicks to u , as i thought it for 2 hrs.
> and still couldn't find a completely correct sol..
>
> On Sep 19, 2:04 pm, Minjie Zha  wrote:
>> Oh yes, I made a mistake.
>> Your are right.
>>
>> On Sep 18, 12:02 am, ashish gupta  wrote:
>>
>>
>>
>> > i think there might be some modification
>>
>> > On Thu, Sep 17, 2009 at 4:17 PM, Minjie Zha  wrote:
>>
>> > > Let PH(j,w) be the probability of getting w heads from 1...j coins,
>> > > 0<=j<=k, 0<=w<=k.
>> > > So we have:
>> > > PH(0,0) = 1
>>
>> >  PH( j, w ) = 0  if w< 0
>>
>> > > PH(0,w) = 0 for w>0
>> > > PH(j,0) = (1-P(1))(1-P(2))...(1-P(j))
>>
>> > > PH(j,w) = PH(j-1,w) + PH(j-1,w-1)PH(j)
>>
>> > and equation should be
>> > PH(j, w)  = PH(j-1,w) (1-P(j)) + PH( j-1, w-1) PH(j)
>>
>> > pls correct if i am wrong...
>>
>> > --
>> > ashish
>>
>> > > Any comments?
>>
>> > > On Sep 9, 5:50 pm, Nagendra Kumar  wrote:
>> > > > @all:
>> > > >           There are k baised coins with probabilty of coming head is
>> > > > P(i)  i = 1 to k.  If all these coins are  tossed together. find the
>> > > > probabilty of getting i heads ( i < = k).
>> > > >    think in Dynamic Programming.
>> > > > -Nagendra
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---