Answer Posted / tamil
Procedural language
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
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
What is the use of f in c?
What is the collection of communication lines and routers called?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is the c value paradox and how is it explained?
Can a local variable be volatile in c?
What are operators in c?
Is it possible to initialize a variable at the time it was declared?
Write a C program to count the number of email on text
Explain what does it mean when a pointer is used in an if statement?
What are keywords in c with examples?
What is the difference between the expression “++a” and “a++”?
What is the difference between struct and typedef struct in c?
Is c call by value?