Question 41
x = m;
y = 1;
while (x - y > e)
{
x = (x + y)/2;
y = m/x;
}
print(x);
Question 42
struct CellNode
{
struct CelINode *leftchild;
int element;
struct CelINode *rightChild;
}
int Dosomething(struct CelINode *ptr)
{
int value = 0;
if (ptr != NULL)
{
if (ptr->leftChild != NULL)
value = 1 + DoSomething(ptr->leftChild);
if (ptr->rightChild != NULL)
value = max(value, 1 + DoSomething(ptr->rightChild));
}
return (value);
}
Question 43
Question 44
E → E1 # T { E.value = E1.value * T.value } | T{ E.value = T.value } T → T1 & F { T.value = T1.value + F.value } | F{ T.value = F.value } F → num { F.value = num.value }Compute E.value for the root of the parse tree for the expression: 2 # 3 & 5 # 6 & 4.
Question 45
Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?
Question 46
Question 47
Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphore operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :
While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY); }
P2 :
While true do { L3 : ................ L4 : ................ Y = Y + 1; X = Y - 1; V(SY); V(SX); }
In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectively
Question 48
Question 49
name, courseNo → grade rollNo, courseNo → grade name → rollNo rollNo → nameThe highest normal form of this relation scheme is
Question 50
There are 90 questions to complete.