Re: [algogeeks] GATE C-Question

2011-07-27 Thread Vijay Khandar
Thanku Sasi .

On Tue, Jul 26, 2011 at 10:49 PM, sasi kumar  wrote:

> hi
> > void XYZ(int a[],int b[], int c[])
> > {
> > int i,j,k;
> > i=j=k=0;
> > while((i > {
> > if (a[i] >  c[k++]=a[i++];
> >  else
> >  c[k++]=b[j++];
> >0
> > }
>
>   In this case either i value or j value is incremented at a time
> in an iteration . So its impossible that both the conditions (i< n)
> and (j means i=n and j < m and k=n+j-1 and that means that i has been
> incremented in the last iteration . so a[i] < b[j] in the last
> iteration .this means a[n-1] < b[j].
>  Similarly if  (j
> >
> > Which of the following condition(s) hold(s) after the termination of
> > the while loop?
> >
> > i)j >
> > ii)i
>   Thus either one or two . but not both . If both are true then the
> loop wont be exited
>
>
> Regards
>
> Sasi kumar T
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] GATE C-Question

2011-07-26 Thread sasi kumar
hi
> void XYZ(int a[],int b[], int c[])
> {
> int i,j,k;
> i=j=k=0;
> while((i {
> if (a[i]  c[k++]=a[i++];
>  else
>  c[k++]=b[j++];
>0
> }

   In this case either i value or j value is incremented at a time
in an iteration . So its impossible that both the conditions (i< n)
and (j
> Which of the following condition(s) hold(s) after the termination of
> the while loop?
>
> i)j
> ii)ihttp://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] GATE C-Question

2011-07-26 Thread rajeev bharshetty
C )

On Tue, Jul 26, 2011 at 9:02 PM, Vijay Khandar wrote:

> Consider the following C-function in which a[n] and b[m] are two
> sorted integer arrays and c[n+m] be an other integer array.
>
>
> void XYZ(int a[],int b[], int c[])
> {
> int i,j,k;
> i=j=k=0;
> while((i {
> if (a[i]  c[k++]=a[i++];
>  else
>  c[k++]=b[j++];
>
> }
>
> Which of the following condition(s) hold(s) after the termination of
> the while loop?
>
> i)j
> ii)i
>
> A)only i
> B)only ii
> C)either i or ii but not both
> D)neither i nor ii
>
> Can I have to take any example
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Regards
Rajeev N B 

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