[algogeeks] Re: SUGGESTIONS

2012-01-01 Thread geek forgeek
anyone ?

On Sun, Jan 1, 2012 at 4:05 PM, geek forgeek  wrote:

> Hello Everyone ,
> I have finished all the standard algorithms in the one - semester
> curriculum of the B-Tech course.
> I want help on the kind of algorithms i should do now .
>
> I get difficulty in doing problems in competitions like on topcoder ,
> codechef etc.So Kindly suggest links or books for the same.
>
> Thanks in advance :D
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] SUGGESTIONS

2012-01-01 Thread geek forgeek
Hello Everyone ,
I have finished all the standard algorithms in the one - semester
curriculum of the B-Tech course.
I want help on the kind of algorithms i should do now .

I get difficulty in doing problems in competitions like on topcoder ,
codechef etc.So Kindly suggest links or books for the same apart from the
algogeeks group..

Thanks in advance :D

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] NUMBER OF MST ?

2011-12-03 Thread geek forgeek
If there are n nodes in a graph connected to each other with edges of same
length .Then how many minimum spanning trees are possible ?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] MS interview:

2011-07-27 Thread geek forgeek
can some one give me the code plz?

On Wed, Jul 27, 2011 at 12:26 AM, sunny agrawal wrote:

> yes Preorder recursion will be good for displaying in User Friendly way...
>
>
> On Wed, Jul 27, 2011 at 12:49 PM, Anand Saha  wrote:
>
>> Implement Preorder Traversal in the File system tree.
>>
>> --
>>
>>
>>
>> On Wed, Jul 27, 2011 at 12:06 PM, geek forgeek wrote:
>>
>>> Function to display the directory structure in a user friendly way taking
>>> root dir as arg
>>> for a general OS. You may assume and state some basic APIs available in
>>> that OS
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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.
>>
>
>
>
> --
> Sunny Aggrawal
> B-Tech IV year,CSI
> Indian Institute Of Technology,Roorkee
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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: MS interview:

2011-07-26 Thread geek forgeek
anyone??

On Tue, Jul 26, 2011 at 11:36 PM, geek forgeek wrote:

> Function to display the directory structure in a user friendly way taking
> root dir as arg
> for a general OS. You may assume and state some basic APIs available in
> that OS
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] MS interview:

2011-07-26 Thread geek forgeek
Function to display the directory structure in a user friendly way taking
root dir as arg
for a general OS. You may assume and state some basic APIs available in that
OS

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] OUTPUT

2011-07-25 Thread geek forgeek
y not the output is 3 2  coz on right to left evaluation  of printf i shud
be left shifted by 1 bit wgich shud make it 2 ??

On Mon, Jul 25, 2011 at 10:28 AM, sameer.mut...@gmail.com <
sameer.mut...@gmail.com> wrote:

> yeah output
>  0
> 1 1
> *is dis because of side effect? *
> * *
> *
> *
> *Muthuraj R.
> 4TH Year BE.**
> Information Science Dept*
> *PESIT, Bengaluru .
> *
>
>
>
>
>
> On Mon, Jul 25, 2011 at 10:49 PM, Deoki Nandan  wrote:
>
>> run on gcc compiler it would be
>> 0
>> 1 1
>>
>>
>> On Mon, Jul 25, 2011 at 10:35 PM, geek forgeek wrote:
>>
>>> 1.
>>> #include
>>> main()
>>> {
>>> int i=1;
>>>  printf("\n%d",i^=1%2);
>>>  printf("\n%d %d",i^=1%2,i<<=1%2);
>>> return 0;
>>> }
>>>
>>> output 3 3
>>> hey shudnt the output be 3 2
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from 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
>> Deoki Nandan Vishwakarma
>>
>> *
>> *
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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] OUTPUT

2011-07-25 Thread geek forgeek
ma mistake

code is
#include
main()
{
int i=1;
 printf("\n%d %d",i^=1%2,i<<=1%2);
return 0;
}



On Mon, Jul 25, 2011 at 10:19 AM, Deoki Nandan  wrote:

> run on gcc compiler it would be
> 0
> 1 1
>
> On Mon, Jul 25, 2011 at 10:35 PM, geek forgeek wrote:
>
>> 1.
>> #include
>> main()
>> {
>> int i=1;
>>  printf("\n%d",i^=1%2);
>>  printf("\n%d %d",i^=1%2,i<<=1%2);
>> return 0;
>> }
>>
>> output 3 3
>> hey shudnt the output be 3 2
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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
> Deoki Nandan Vishwakarma
>
> *
> *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] OUTPUT

2011-07-25 Thread geek forgeek
1.
#include
main()
{
int i=1;
printf("\n%d",i^=1%2);
printf("\n%d %d",i^=1%2,i<<=1%2);
return 0;
}

output 3 3
hey shudnt the output be 3 2

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] output plzz

2011-07-23 Thread geek forgeek
#include
main()
{
char outline[50];
char one[7],two[7],four[7],five[7];
int three;
sprintf(outline,"this is %d times %s \n",10,"charlie");
printf("%s",outline);
sscanf(outline,"%s %s %d %s %s",&one,&two,&three,&four,&five);
printf("%s",one);
printf("%s",two);
printf("%d",three);
printf("%s",four);
printf("%s",five);
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] output plzz

2011-07-23 Thread geek forgeek
even i second this gud idea

On Sat , Jul 23, 2011 at 8:40 AM, sameer.mut...@gmail.com <
sameer.mut...@gmail.com> wrote:

> @shady: yes its a good idea to have aptitude puzzles etc in other group
>
>
> On Sat, Jul 23, 2011 at 8:29 AM, shady  wrote:
>
>> nice idea Saurabh, but i don't think much people will join that group too,
>> and the difference should be on the basis of type of questions asked. Any
>> suggestions from others ? There we can ask questions related to debugging
>> and puzzles, aptitude
>>
>>
>> On Sat, Jul 23, 2011 at 8:51 PM, saurabh singh wrote:
>>
>>> The break statement here breaks out of the do loop so the o/p hello hmmm
>>> give a break statement after hello and you will get only hello.
>>>
>>> PS:Seeing the number of C questions wont it be a better idea to start a
>>> parallel group especially for the same?My request to the group admins for
>>> the same.
>>>
>>>
>>> On Sat, Jul 23, 2011 at 8:47 PM, geek forgeek wrote:
>>>
>>>> #include
>>>> main()
>>>> {
>>>> int i=3;
>>>> switch(i)
>>>> {
>>>> do
>>>> {
>>>> case 3: printf("\nhello");
>>>> case 2:printf("\n h");
>>>> break;
>>>> case 1:printf("wat");
>>>> break;
>>>> case 0: printf("hai");
>>>> }while(i--);
>>>> }
>>>> }
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from 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.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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] output plzz

2011-07-23 Thread geek forgeek
#include
main()
{
int i=3;
switch(i)
{
do
{
case 3: printf("\nhello");
case 2:printf("\n h");
break;
case 1:printf("wat");
break;
case 0: printf("hai");
}while(i--);
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: C OUTPUT HELP

2011-07-22 Thread geek forgeek
@nicks -- ur code for 1st problem is giving me 1 not -1 on gcc..which
compiler are you using

On Fri, Jul 22, 2011 at 11:58 AM, sumit  wrote:

> +1 to t3rminal
>
>
> On Jun 12, 11:38 pm, T3rminal  wrote:
> > @all
> > Stop guessing and making your own standards. C standards haven't
> > defined anything (though in gcc arguments are processed from left to
> > right) about processing arguments in a function call. And sentence
> > like "assgnment to a preincrement expression is delayed vry mch"
> > have no meaning . Seriously which book have you referred.
> > This all fall in category of UNDEFINED BEHAVIOR.
> > If a value of a variable is changed more than once between two
> > sequence points, it give rises to side-effect which lead to undefined
> > behavior.
> > There is no explanation for this output supported by C standards.
> > On Jun 12, 8:14 pm, varun pahwa  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > yes the output is compiler dependent.
> >
> > > On Sun, Jun 12, 2011 at 6:35 AM, nicks 
> wrote:
> > > > but program by anika is giving *7 6 8* on gcc.but *7 6 6 *on
> > > > dev-cpp...i am wondering if the output is compiler dependent
> !!
> >
> > > > On Sun, Jun 12, 2011 at 6:33 AM, nicks 
> wrote:
> >
> > > >> no it's
> > > >> a=1 b=1
> > > >> i=2
> >
> > > >> i ran it on gcc (linux ubuntu 11.04)
> >
> > > >> On Sun, Jun 12, 2011 at 6:26 AM, sanjay ahuja <
> sanjayahuja.i...@gmail.com
> > > >> > wrote:
> >
> > > >>> with GCC the above code gives a = 1 and b = 2
> >
> > > >>> On Sun, Jun 12, 2011 at 6:39 PM, nicks  >
> > > >>> wrote:
> > > >>> > @himanshuwhat abt this ??
> >
> > > >>> > #include
> > > >>> > # include 
> > > >>> > int i=2;
> > > >>> > main()
> > > >>> > {
> > > >>> >  void add();
> > > >>> >  add(i++,--i);
> > > >>> > printf("\ni=%d \n",i);system("pause");
> > > >>> > }
> > > >>> > void add(int a ,int b)
> > > >>> > {
> > > >>> >  printf("\na=%d b=%d",a,b);
> > > >>> > }
> >
> > > >>> >  OUTPUT -
> > > >>> > a=1 b=1
> > > >>> > i=2
> >
> > > >>> > acc. to ur logic output should be -
> > > >>> > a=1 b=2
> > > >>> > i=2
> >
> > > >>> > On Sun, Jun 12, 2011 at 5:42 AM, Anika Jain <
> anika.jai...@gmail.com>
> > > >>> wrote:
> >
> > > >>> >> thanks himanshu finally i got the reason!!
> > > >>> >> :)
> >
> > > >>> >> On Sun, Jun 12, 2011 at 5:59 PM, himanshu kansal
> > > >>> >>  wrote:
> >
> > > >>> >>> @anika:cz on gcc arguemnts r eval frm right to left and
> assgnment to
> > > >>> a
> > > >>> >>> pre increment expression is delayed vry mch
> > > >>> >>> so on eval frm right to left
> > > >>> >>> frst a is incremented...(6) bt remember d new value is nt
> pushed on
> > > >>> stack
> > > >>> >>> till nw(cz assgnmnt is delayed)
> > > >>> >>> thn next value is 6...nd thn a is incremented.here being a
> post
> > > >>> >>> increment opassgnmnt is made 1st (2nd arg to fun is 6)and a
> is
> > > >>> >>> incrementd to 7
> > > >>> >>> simalrly.assgnmnt is made(1st arg is 7) and a is incremnted
> to
> > > >>> 8.
> > > >>> >>> nw d assgnmnt is made to the 3rd arg(d assgnmnt whch ws delayed
> till
> > > >>> >>> nw).hence 3rd arg becomes 8.
> > > >>> >>> so it prints 7 6 8..
> >
> > > >>> >>> On Sun, Jun 12, 2011 at 5:33 PM, Anika Jain <
> anika.jai...@gmail.com>
> > > >>> >>> wrote:
> >
> > > >>>  can anybody explain that in following code y output is coming
> to be:
> > > >>> 7 6
> > > >>>  8
> >
> > > >>>  void call(int a,int b,int c)
> > > >>>  {
> > > >>>   printf("%d %d %d",a,b,c);
> > > >>>  }
> >
> > > >>>  int main()
> > > >>>  {
> > > >>>  int a=5;
> > > >>>  call(a++,a++,++a);
> > > >>>  return 0;
> > > >>>  }
> >
> > > >>>  On Sat, Jun 11, 2011 at 8:21 PM, PRAMENDRA RATHi rathi
> > > >>>   wrote:
> >
> > > >>> > IN second program:
> > > >>> >  in function value are always push in the stack from right.
> > > >>> > so first value is --i that will make i=1 and value 1 will be
> passed
> > > >>> to
> > > >>> > function
> > > >>> > and
> > > >>> > after that i++ that's means i will be passed.
> > > >>> > so 1 will be passed and after passing value. i will changed
> to 2.
> >
> > > >>> > if u want to know why reverse order than can go through:
> >
> > > >>> >http://cs.nyu.edu/courses/fall03/V22.0201-003/c_param.html
> > > >>> > -
> > > >>> > PRAMENDRA RATHI
> > > >>> > NIT ALLAHABAD
> >
> > > >>> > On Sat, Jun 11, 2011 at 7:28 PM, Vishal Thanki <
> > > >>> vishaltha...@gmail.com>
> > > >>> > wrote:
> >
> > > >>> >> In 1st program, 2nd printf requires one more argument. And
> > > >>> basically
> > > >>> >> %a is used for printing a double value in hex. see "man 3
> printf".
> >
> > > >>> >> On Sat, Jun 11, 2011 at 5:29 PM, nicks <
> > > >>> crazy.logic.k...@gmail.com>
> > > >>> >> wrote:
> > > >>> >> > Hello friends..plz help me in understanding the following
> C

[algogeeks] xplain output

2011-07-22 Thread geek forgeek
#include
void main()
{
int x;
float t;
scanf("%f",&t);
printf("%f\n",t);
x=90;
printf("%f\n",x);
{
x=1;
printf("%f\n",x);
{
x=30;
printf("%f\n",x);
}
printf("%f\n",x);
}
x==9;
printf("%f\n",x);
}

input
1.1

output
1.10
1.09
1.09
1.09
1.09
1.09

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] explain plzz:output in file old.out

2011-07-22 Thread geek forgeek
@shady and @varun ...
i hav got it
thanx both of u  :)

On Fri, Jul 22, 2011 at 11:31 AM, shady  wrote:

> @aditi the problem is scanf returns -1(EOF value) when it encounters the
> end of file, and inspite of comparing the return value of scanf he is
> comparing value of character 'a' which is not correct
> therefore the for loop should be like this :
>
> for(int t=scanf("%c",&a);t!=EOF;t=scanf("%c",&a))
>
> what varun suggested is another way of doing it :)
>
> On Fri, Jul 22, 2011 at 11:41 PM, aditi garg wrote:
>
>> @shady. so in this case we shud use a!=-1 as the condition??
>>
>>
>> On Fri, Jul 22, 2011 at 11:37 PM, shady  wrote:
>>
>>> you are scanning from stdin therefore it is not coming out of first for
>>> loop... because your terminating condition is for EOF, which is -1( scanf
>>> returns -1 ) at the end.
>>>
>>>
>>> On Fri, Jul 22, 2011 at 11:34 PM, shady  wrote:
>>>
>>>> well you didn't mention the question, directly posted the code with no
>>>> head-tail... wait will answer, it is not coming out of first loop
>>>>
>>>>
>>>> On Fri, Jul 22, 2011 at 11:26 PM, geek forgeek 
>>>> wrote:
>>>>
>>>>> @shady this is nt a joke..
>>>>> sorry if i am asking too stupid question
>>>>> i m getting an infinite loop here.
>>>>> not getting how?
>>>>>
>>>>>
>>>>> On Fri, Jul 22, 2011 at 10:40 AM, shady  wrote:
>>>>>
>>>>>> what kind of joke is this ?
>>>>>>
>>>>>> On Fri, Jul 22, 2011 at 11:02 PM, geek forgeek >>>>> > wrote:
>>>>>>
>>>>>>> #include
>>>>>>> main()
>>>>>>> {
>>>>>>> FILE *fp;
>>>>>>> char a;
>>>>>>> fp=fopen("old.out","w");
>>>>>>> if(fp==0)
>>>>>>> printf("File opening error");
>>>>>>> else
>>>>>>> {
>>>>>>> for(scanf("%c",&a);a!=EOF;scanf("%c",&a))
>>>>>>> fprintf(fp,"%c",a);
>>>>>>> fclose(fp);
>>>>>>> fp=fopen("old.out","r");
>>>>>>> while(!feof(fp))
>>>>>>> putchar(getc(fp));
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Algorithm Geeks" group.
>>>>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>>> To unsubscribe from 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.
>>>
>>
>>
>>
>> --
>> Aditi Garg
>> Undergraduate Student
>> Electronics & Communication Divison
>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>> Sector 3, Dwarka
>> New Delhi
>>
>> 9718388816
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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] explain plzz:output in file old.out

2011-07-22 Thread geek forgeek
@shady this is nt a joke..
sorry if i am asking too stupid question
i m getting an infinite loop here.
not getting how?

On Fri, Jul 22, 2011 at 10:40 AM, shady  wrote:

> what kind of joke is this ?
>
> On Fri, Jul 22, 2011 at 11:02 PM, geek forgeek wrote:
>
>> #include
>> main()
>> {
>> FILE *fp;
>> char a;
>> fp=fopen("old.out","w");
>> if(fp==0)
>> printf("File opening error");
>> else
>> {
>> for(scanf("%c",&a);a!=EOF;scanf("%c",&a))
>> fprintf(fp,"%c",a);
>> fclose(fp);
>> fp=fopen("old.out","r");
>> while(!feof(fp))
>> putchar(getc(fp));
>> }
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from 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] explain plzz:output in file old.out

2011-07-22 Thread geek forgeek
#include
main()
{
FILE *fp;
char a;
fp=fopen("old.out","w");
if(fp==0)
printf("File opening error");
else
{
for(scanf("%c",&a);a!=EOF;scanf("%c",&a))
fprintf(fp,"%c",a);
fclose(fp);
fp=fopen("old.out","r");
while(!feof(fp))
putchar(getc(fp));
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: EXPLAIN THE OUTPUTS

2011-07-19 Thread geek forgeek
@schrodinger  y a[] value is not lost in first call.it should be lost in
first call only?

On Tue, Jul 19, 2011 at 8:24 PM, schrodinger <6fae1ce6347...@gmail.com>wrote:

> First output of memory location is fine.
> Second output is also expected one.
> Third output will vary compiler to compiler and from time to time.
>
> This is because a[] is a local  to fun(). First time when you call
> printf("%d\n",r[0]) its fine. but after executing printf() location of r is
> lost and hence you'll get different output is undefined.
>
>  --
> 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/-/gzaXX7gzytAJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] OUTPUT

2011-07-18 Thread geek forgeek
int main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}


y output is 5 4 3 2 1

not 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5

y on each recursive call var is not initialized again.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] MICROSOFT

2011-07-17 Thread geek forgeek
ohh its pretty easy i cudnt make it in the written..
nywayz thanx @nishant and @anurag

On Sun, Jul 17, 2011 at 4:35 PM, Anurag Aggarwal  wrote:

> take two extra arrays b[] and c[]
> in b[] store the following thing
> b[0]=1;
> b[i]=b[i-1]*a[i-1];
>
>
> in c[] store following things
> c[n-1]=1;
> c[i]=c[i+1]*a[i+1]   (i>n-1)
> fill the c[] array in reverse order i.e. start from n-1 then go to 0;
>
> now output[] would be
> output[i]=b[i]*c[i];
>
>
>
>
> On Sun, Jul 17, 2011 at 4:28 PM, geek forgeek wrote:
>
>> given an array a[0..n-1]  .required to find the output array out
>> [0.n-1] such that out [i] is the product of all the numbers a[0] to
>> a[n-1] excluding a[i]
>> for ex out[2]=a[0]*a[1]*a[3]*a[4]a[n-1]
>> constraint is not using division operator
>>
>> how to do this in O(n)??
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
> Anurag Aggarwal
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] MICROSOFT

2011-07-17 Thread geek forgeek
given an array a[0..n-1]  .required to find the output array out
[0.n-1] such that out [i] is the product of all the numbers a[0] to
a[n-1] excluding a[i]
for ex out[2]=a[0]*a[1]*a[3]*a[4]a[n-1]
constraint is not using division operator

how to do this in O(n)??

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-07-11 Thread geek forgeek
#include
main(){int a=10,b;
a>=5?b=10:b=20;printf
("%d\n",b);}

y this is asking for lvalue
while this(below) not?


#include
main(){int a=10,b;
a>=5?b=10:(b=20);printf
("%d\n",b);}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: segment tree

2011-07-04 Thread geek forgeek
thanx  @991..
yeah i read it..
but i didnt get how to update the tree they havnt hav given tht.
is their any good pdf file with any1 on the grup...

plz share it !!


On Mon, Jul 4, 2011 at 6:50 PM, 991  wrote:

>
> Try this:
>
>
> http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor
>
> On Jul 4, 5:15 pm, geek forgeek  wrote:
> > any1
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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: segment tree

2011-07-04 Thread geek forgeek
any1

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] segment tree

2011-07-04 Thread geek forgeek
-- Forwarded message --
From: geek forgeek 
Date: Mon, Jul 4, 2011 at 2:58 PM
Subject: segment tree
To: algog...@googlegroups.com


can any1 plz tell some gud tutorial for segment tree?

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