Re: [algogeeks] C output... ???

2010-12-16 Thread UMESH KUMAR
#define SIZE 10 int main() { int arr[SIZE]; printf(size of array is:%d\n,sizeof(arr)); return 0; } when we call the function and pass the name of the ARRAY ,then PUSH the base Address of the ARRAY in the Stack of the Calling Function not PUSH the

Re: [algogeeks] tricky C aps ques

2010-12-16 Thread UMESH KUMAR
main() { int a[5]={1,3,6,7,0}; int *b; b=a[2]; coutb[-1]; } the value of b[-1] is a.1 b.3 c.-6 d.none ANS will be 3. Because Compiler internally first converted in the form as *(b-1) , and get the one position back at the position 3. -- You received this message because you

[algogeeks] SUN Microsystem Question

2010-12-16 Thread bittu
Why Interpreting the program more costly them compilationexplain briefly.. Regards Shashank -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group,

Re: [algogeeks] tricky C aps ques

2010-12-16 Thread Ankur Khurana
A[i]=A+i; so 3. On Thu, Dec 16, 2010 at 5:25 PM, UMESH KUMAR kumar.umesh...@gmail.com wrote: main() {  int a[5]={1,3,6,7,0};  int *b;  b=a[2];  coutb[-1]; } the value of b[-1] is a.1 b.3 c.-6 d.none ANS will be 3. Because Compiler internally first converted in the form as  

[algogeeks] dear,Good day! hoykbbd!

2010-12-16 Thread Rakesh Reddy
dear friend how are you doing recently ? i found a very good site : www.yang-fangfang2.com I bought an Apple laptop a week ago from this site. Now, I have been received. This product quality is very good. and price also very cheap. They also sell mobile phones, television sets, motorcycles and so

[algogeeks] Answer This

2010-12-16 Thread punnu
In an ancient village, there were some green-eyed and blue-eyed persons. One fi ne day, God instructed them, the day on which you come to know that you are a green-eyed, you should commit suicide ... He also assured them that there was at least one green-eyed among them. Well, all the villagers

[algogeeks] help

2010-12-16 Thread kumar0746 kerth
problem:https://www.spoj.pl/problems/PARTY/ i m getting wrong answer for dis problem.can anyone help me in finding de mistake..thank u in advance #includeiostream //#includeconio.h #includevector #includealgorithm using namespace std; //int n; int item(int c[][501],int i,int wt,vectorint w,int

Re: [algogeeks] help

2010-12-16 Thread bharath kannan
machi use this.. Define *m*[*i*,*w*] to be the maximum value that can be attained with weight less than or equal to *w* using items up to *i*. We can define *m*[*i*,*w*] recursively as follows: - [image: m[0,\,w]=0] - [image: m[i,\,0]=0] - [image: m[i,\,w]=m[i-1,\,w]] if [image:

Re: [algogeeks] Answer This

2010-12-16 Thread Aditya Agrawal
20 green eys ppl .. At the end of first day person realize no body dies so he is the one with green eye's so he commit sucide ... Similarly on second day .. hence forth 20 people commit suicide in 20 days .. On Fri, Dec 17, 2010 at 11:05 AM, punnu punnu.gino...@gmail.com wrote: In an ancient

Re: [algogeeks] Answer This

2010-12-16 Thread Krishna Narasimhan
Aditya, 1) Nobody dies on the first 19 days everyone dies on the 20th day. 2) Even if it wasnt the case, why should he die just because nobody else did? Is there any condition on THERE SHOULD BE ATLEAST ONE GREEN EYED GUY? On Fri, Dec 17, 2010 at 12:52 PM, Aditya Agrawal adit6...@gmail.com

Re: [algogeeks] array

2010-12-16 Thread Aditya Agrawal
a[]={-3,2,4,-6,-8,10,11} create an array with cumulative sum: b[]={-3,-1,3,-3,-11,-1,10}. Now identify the maximum index distance same value. in this case distance b/w -3,-3 is maximum so subarray would be 2,4,-6,-8,10 On Wed, Dec 15, 2010 at 6:23 PM, Soumya Prasad Ukil

Re: [algogeeks] Answer This

2010-12-16 Thread Iqbal Nouyed
I think Aditya is correct, 1) it never says nobody dies on the first 19 days, just says by the 20th day all the green eyed commit suicide. 2) God said that, He also assured them that there was at least one green-eyed among them. Cheers. On Fri, Dec 17, 2010 at 1:30 PM, Krishna Narasimhan

Re: [algogeeks] Re: Max Heap + Binary Search Tree

2010-12-16 Thread Algoose chase
To insert a node into a tree with such a property: First insert the node into the tree using the rules of Binary Search tree based on Value i . Now compare Node-j and Node-Parent-j. Depending upon the result of comparison perform left rotation or right rotation so that the Heap property is also

[algogeeks] Re: coins

2010-12-16 Thread Greed
for i=1 to n for j=1 to n coins[i][j]=coins[i][j]+ max(coins[i-1][j],coins[i][j-1]); This is a bottom up DP. Time complexity O(n^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] Generic Linked list

2010-12-16 Thread siva viknesh
How to implement a generic linked list?? ..this is one of the frequently asked interview question ..for this we have to use void pointers struct node { void *data; struct node *link; }; ..can anybody plz give more detailed explanation and complete implementation on this?? And what is its

[algogeeks] What can be done in c but not c++?

2010-12-16 Thread siva viknesh
We can assign any type of pointer to void pointer without cast in c but not in c++. Declare variable names that are keywords in C++ but not C. ...if anybody knows more do update in this thread.:). -- Regards, $iva -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Answer This

2010-12-16 Thread vamsee marpu
Ans : Total 20 green-eyed people were there in the village. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to