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 rahul23111...@gmail.comwrote: *Let

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 togauravcha...@gmail.comwrote: 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

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

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

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 vishalyada...@gmail.comwrote: Because you can always find a

[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((in)(jm)) { if (a[i]b[j]) c[k++]=a[i++]; else c[k++]=b[j++]; } Which of the following condition(s)

Re: [algogeeks] GATE C-Question

2011-07-26 Thread rajeev bharshetty
C ) On Tue, Jul 26, 2011 at 9:02 PM, Vijay Khandar vijaykhand...@gmail.comwrote: 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((in)(jm)) { if

[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((in)(jm)) { if (a[i]b[j]) c[k++]=a[i++]; else c[k++]=b[j++]; } Which of the following condition(s)

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((in)(jm)) { if (a[i]b[j])  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 (jm)

[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

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 kunalkapadi...@gmail.com 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

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 abhijith200...@gmail.comwrote: p[3] = 'E' p[1] = 'A' p[3]-p[1] = 4 ? On Sat, Jul 2, 2011 at 7:10 PM, KK kunalkapadi...@gmail.com wrote: 10. What does the following fragment of

[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