There are 3 baskets of fruits with worng lables,one basket
has apple,another basket has orange,another has combination
of apple and orange,what is the least way of interchange
the lables.
Answer Posted / muthurangaraja
In this question they will say that baskets are labelled but not closed . so we can easily interchange the fruits
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can I write a function that takes a format string and a variable number of arguments?
How is pointer initialized in c?
What does %c mean in c?
Why does everyone say not to use scanf? What should I use instead?
why return type of main is not necessary in linux
What is omp_num_threads?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
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
Write a program to check whether a number is prime or not using c?
What is data structure in c language?
Why we use int main and void main?
What is operator promotion?
Why do we use namespace feature?
Why we use void main in c?
What is break statement?