TCS NQT - cap ability

Test Number 3/11

Q: Choose the correct option.
Let S be the original stack and S1 and S2 the two additional stacks then the following pseudo code is to reverse the stack S:

while (S not empty)
{
push(S1,pop(S));
}

while(S1 not empty)
{
push(S2,pop(S1));
}

while(S2 not empty)
{
push(S,pop(S2));
} ?
A. TRUE 76%
B. False 17%
C. Not Answer 6%
D. nun of above
Solution: Here is no explanation for this answer
Q: Choose the correct option.
The postfix form of the expression (A+ B)*(C*D-E)*F / G is
A. AB+CD*E-FG/** 60%
B. AB+CD*E-F**G/ 12%
C. AB+CD*E-*F*G/ 18%
D. AB+CDE*-*F*G/ 10%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
he data structure required to check whether an expression contains balanced parenthesis is

A. Stack 88%
B. Queue 6%
C. Tree 4%
D. Array 2%
Solution: Here is no explanation for this answer
Q: 
Choose the correct option.
Analyse this structure and choose the correct option.

typedef struct node_s
{
struct node_s * prev;
struct node_s * next;
} node_t ; ?
A. This could be a node in a doubly linked list 34%
B. The syntax is incorrect 18%
C. The syntax is incorrect 16%
D. A linking error would occur because no data is present 32%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
"p" and "q" are pointers to a node of the linked list, "head" points to the first node of the list, "next" points to the next node in the list, which of the following is true for the following piece of code:

for (p=head, q = head; p!=NULL; q = p)
{
p = p->next;
free(q);
}
A. Deletes all nodes 37%
B. Deletes all but the last node 28%
C. Does not delete any node 17%
D. The program will crash 18%
Solution: Here is no explanation for this answer
Q: 
What does the following function return, if q contains the address of the first element?
int function(NODE *q)
{ 
int c = 0;
while( q != NULL)
{ 
q = q->link;
c++;
} 
return (c);
} ?
A. The value of the last node of the linked list 25%
B. The value of the first elements of the linked list 17%
C. The address of the last element of the linked list 18%
D. The number of elements in a linked list 40%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
Which among the following is true for doubly linked list ?
A. The left pointer of the right most node and no condition on the left most node 16%
B. The right pointer of the right most node and no condition on the left most node 42%
C. The left pointer of the right most node and right pointer of the left most node are null 14%
D. The left pointer of the left most node and right pointer of the right most node are null 28%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
The situation when in a linked list START=NULL is
A. Underflow 66%
B. Overllow 17%
C. Housefull 4%
D. Saturated 13%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
Linked lists are best suited
A. for relatively permanent collections of data 13%
B. for the size of the structure and the data in the structure are constantly changing 53%
C. for both of above situation 27%
D. for none of above situation 8%
Solution: Here is no explanation for this answer
Q: Choose the correct option.
Linked lists are best suited for
A. relatively permanent collections of data 6%
B. the size of the structure and the data in the structure are constantly changing 86%
C. both of above situation 5%
D. none of above situation 3%
Solution: Here is no explanation for this answer

You Have Score    /10