[algogeeks] C doubt

2011-07-31 Thread Tyler Durden
How do we declare an array of N pointers to functions that return int?? An array of N pointers to integers is this: int *p[N] Just can't figure out the case for pointers to function -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view

[algogeeks] Re: C doubt

2011-07-31 Thread Tyler Durden
Is it right?? declare an array of pointers like, int *func[N]; and since they are pointers to functions, modify above as, int (*func[N])(); -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Re: AMAZON Q

2011-07-28 Thread Tyler Durden
@Rajeev: How will you update the position of each element in the linked list after removing a particular element? Won't you have to traverse the list completely in which case your algo will be O(n^2) ?? -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: AMAZON Q

2011-07-28 Thread Tyler Durden
@Rajeev: Okay, I am using C which has no such facilities of auto indexing the list.. -- 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/-/BsMmVwxw_T4J. To post

Re: [algogeeks] Re: C output

2011-07-28 Thread Tyler Durden
Only a warning in Dev C++ due to no variable declaration of inner structure -- 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/-/HtevjjeGDZoJ. To post to this

Re: [algogeeks] Re: sizeof() question.

2011-07-28 Thread Tyler Durden
No, it's wrong to say that sizeof() can't be applied to functions. It's an operator and can take the function name as its operand. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Re: Facebook Interview question at NIT Warangal

2011-07-28 Thread Tyler Durden
#includestdio.h #includemath.h int set_bits(int a) { int c=0; while(a) { if(a 1) c++; a =1; } return c; } void sub(int a[],int n,int k) { int i; int x,c=0,j; x = pow(2,n); for(i=0;ix;i++) //this statement is exec 2^n

Re: [algogeeks] Small Doubt

2011-07-27 Thread Tyler Durden
@Ankita: So when is 4000 memory address is allotted?? I mean what use does int *p = 4000 serve here?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit