Programming & DS Rapid Quiz -2 (App update required to attempt this test)
Attempt now to get your rank among 570 students!
Question 1
5 , 12 , 3 , 15 , 4 , 6 , 10
These elements are inserted one-by-one into two separate heaps , one min heap and another max heap. Then these two heaps are stored in two different array starting form index How many elements have different index value in both the arrays ___________.
Question 2
α : Given G(V, E), does G have an independent set of size | V | – 4?
β : Given G(V, E), does G have an independent set of size 5?
Which one of the following is TRUE?
Question 3
Two leaf nodes are marked as X and Y, the values of which are missing. Let the number of values node marked X can take is "a", and the number of values node marked Y can take is "b". The values placed in leaf nodes marked as X and Y should be such that all the nodes in the BST have distinct values. Assume that all the values are integers.
Find the value of 10b+a __________.
Question 4
double f(double x)
{
if (abs (x*x – 3) < 0. 01)
return x;
else
return f(x / 2 + 1.5/x);
}
Give a value q (to 2 decimals) such that f(q) will return q:______.
Question 5
main()
{
int u =1;
int v = 3;
printf(“u = %d”, v =%d”, u, v);
funct1(u, v);
printf(“u = %d”, v = %d”, u, v);
funct2(&u, &v);
printf(“u = %d”, v = %d”, u, v);
}
funct1( int u, int v)
{
u = u + v;
v = u – v;
u = u – v;
}
funct2( int *pu, int *pv)
{
*pu = *pu + *pv;
*pv = *pu - *pv;
*pu = *pu - *pv;
}
Question 6
• Push(1)
• Push(3)
• Push(2)
• Pop
• Pop
Find the total number of enqueue/dequeue operations involved in this process_________.
- 570 attempts
- 1 upvote
- 1 comment