Re: [algogeeks] Gate complaxity question

2012-08-26 Thread rahul sharma
@ll...thnx a lot On Sat, Aug 25, 2012 at 8:22 PM, GAURAV CHAWLA wrote: > see A(n)ie the average case will always be smaller or equal to the > worst case... > > ie something like... A(n)<= c. w(n) for some c as constt ... which the > definition of big O... > >correct me if i'm wrong..

Re: [algogeeks] Gate complaxity question

2012-08-26 Thread GAURAV CHAWLA
see A(n)ie the average case will always be smaller or equal to the worst case... ie something like... A(n)<= c. w(n) for some c as constt ... which the definition of big O... correct me if i'm wrong.. On Sat, Aug 25, 2012 at 7:11 PM, rahul sharma wrote: > *Let w(n) and A(n) denote re

Re: [algogeeks] Gate complaxity question

2012-08-25 Thread vishal yadav
You have to discard option d because , according to definition of small o notation if f(n) =o(g(n)) then for ALL constants c> 0 you have f(n) < cg(n). or Lim(n->infinite) f(n)/g(n) = 0. On Sat, Aug 25, 2012 at 10:24 PM, vishal yadav wrote: > Because you can always find a positive constant c for w

Re: [algogeeks] Gate complaxity question

2012-08-25 Thread vishal yadav
Because you can always find a positive constant c for which following inequality hold true. A(n) <= cW(n) i.e. the avg. case time complexity always upper bounded by worst case time complexity. Which is the definition of Big O. On Sat, Aug 25, 2012 at 7:11 PM, rahul sharma wrote: > *Let w(n) and

[algogeeks] Gate complaxity question

2012-08-25 Thread rahul sharma
*Let w(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. which of the following is ALWAYS TRUE?* (A) [image: A(n) = \Omega(W(n))] (B) [image: A(n) = \Theta(W(n))] (C) [image: A(n) = O(W(n))] (D) [image: A(n) = o(W(n))] ans

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

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

[algogeeks] GATE C-Question

2011-07-26 Thread Vijay Khandar
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((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++]; >

[algogeeks] GATE C-Question

2011-07-26 Thread Vijay Khandar
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((ihttp://groups.google.com/group/algogeeks?hl=en.

Re: [algogeeks] GATE 2011 C Ques

2011-07-02 Thread sameer.mut...@gmail.com
ASCII value of 'A' is 65 and Asciivalue of 'E' is 69. 69-65=4 On Sat, Jul 2, 2011 at 7:12 PM, abhijith reddy wrote: > p[3] = 'E' > p[1] = 'A' > p[3]-p[1] = 4 > ? > > > On Sat, Jul 2, 2011 at 7:10 PM, KK wrote: > >> 10. What does the following fragment of C-program print? >> >> char c[] = "GATE20

Re: [algogeeks] GATE 2011 C Ques

2011-07-02 Thread abhijith reddy
p[3] = 'E' p[1] = 'A' p[3]-p[1] = 4 ? On Sat, Jul 2, 2011 at 7:10 PM, KK wrote: > 10. What does the following fragment of C-program print? > > char c[] = "GATE2011"; > char *p =c; > printf("%s", p + p[3] - p[1]); > > (A) GATE2011 (B) E2011 (C) 2011 (D) 011 > Answer: - (C) > > why is p[3] - p[1]

[algogeeks] GATE 2011 C Ques

2011-07-02 Thread KK
10. What does the following fragment of C-program print? char c[] = "GATE2011"; char *p =c; printf("%s", p + p[3] - p[1]); (A) GATE2011 (B) E2011 (C) 2011 (D) 011 Answer: - (C) why is p[3] - p[1] returning 4 -- You received this message because you are subscribed to the Google Groups "A

[algogeeks] GATE

2011-01-15 Thread SUDHIR MISHRA
sugest study material for gate 2011 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For mo