If I want to initialize the array like.
int a[5] = {0};
then it gives me all element 0.
but if i give int a[5] = {5};
then 5 0 0 0 0 is ans.
what will I do for all element 5 5 5 5 5 in a single
statement???
Answer Posted / n
int a[5]={5,5,5,5,5};
| Is This Answer Correct ? | 27 Yes | 1 No |
Post New Answer View All Answers
What is a pragma?
C program to find all possible outcomes of a dice?
How to Throw some light on the splay trees?
What is the size of enum in c?
program to convert a integer to string in c language'
Write a program which returns the first non repetitive character in the string?
What is the use of linkage in c language?
What is clrscr ()?
Explain how can you tell whether two strings are the same?
Tell me when is a void pointer used?
Explain the advantages and disadvantages of macros.
What does calloc stand for?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
How does sizeof know array size?
List a few unconditional control statement in c.