#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
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
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,
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
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
In an ancient village, there were some green-eyed and blue-eyed
persons. One fine 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
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
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:
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
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
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
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
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
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
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
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
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
17 matches
Mail list logo