Placement Written test paper for MNC  Computer questions and answers Part – 6
Ques 151 : Choose the correct answer  
Which of the following statements are true about a doublylinked list?  
Option 1 : it may be either linear or circular  Option 2 : it must contain a header node  Option 3 : it will occupy same memory space as that of linear linked list, both having same number of nodes  Option 4 : None of these  


Ques 152 : Choose the correct answer  
Which of the following data structure may give overflow error, even though the current number of element in it is less than its size ?  
Option 1 : Queue implemented in a linear array  Option 2 : Queue implemented in a circularly connected array  Option 3 : Stack implemented in a linear array  Option 4 : none of these  


Ques 153 : Choose the correct answer  
Number of possible ordered trees with 3 nodes A, B, C is  
Option 1 : 16  Option 2 : 12  Option 3 : 13  Option 4 : 14  


Ques 154 : Choose the correct answer  
The best sorting methods if number of swapping done is the only measure of efficiency is  
Option 1 : Bubble sort  Option 2 : Selection sort  Option 3 : Insertion sort  Option 4 : Quick sort  


Ques 155 : Choose the correct answer  
As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be  
Option 1 : bubble sort  Option 2 : insertion sort  Option 3 : selection sort  Option 4 : heap sort  


Ques 156 : Choose the correct answer  
A hash table can store a maximum of 10 records. Currently there are records in locations 1, 3, 4, 7, 8, 9, 10. The probability of a new record going into location 2, with a hash function resolving collisions by linear probing is  
Option 1 : 0.6  Option 2 : 0.1  Option 3 : 0.2  Option 4 : 0.5  


Ques 157 : Choose the correct answer  
A full binary tree with n leaves contains  
Option 1 : 2n + 1 nodes  Option 2 : log_{2} n nodes  Option 3 : 2n – 1 nodes  Option 4 : 2n nodes  


Ques 158 : Choose the correct answer  
An array contains the following elements in order: 7 6 12 30 18. Insertion sort is used to sort the array in ascending order. How many times will an insertion be made?  
Option 1 : 2  Option 2 : 3  Option 3 : 4  Option 4 : 5  


Ques 159 : Choose the correct answer  
An array of 5 numbers has the following entries in order: 7 4 5 10 8. Prashant uses selection sort to sort this array in descending order. What will the array contain after two iterations of selection sort?  
Option 1 : 10 8 7 5 4  Option 2 : 10 8 5 7 4  Option 3 : 8 10 5 7 4  Option 4 : None of these  


Ques 160 : Choose the correct answer  
Srishti writes a program to find an element in the array A[5] with the following elements in order: 8 30 40 45 70. She runs the program to find a number X. X is found in the first iteration of binary search. What is the value of X?  
Option 1 : 40  Option 2 : 8  Option 3 : 70  Option 4 : 30  


Ques 161 : Choose the correct answer  
The array A has n elements. We want to determine the position of X in the array. We know that X is present in the array A and X can be present at any location in the array with equal probability. How many comparisons will be required on average to find the element X using linear search?  
Option 1 : n  Option 2 : (n+1)/2  Option 3 : 2*n  Option 4 : n^2  


Ques 162 : Choose the correct answer  
A is an empty stack. The following operations are done on it. PUSH(1) PUSH(2) POP PUSH(5) PUSH(6) POP What will the stack contain after these operations. (Top of the stack is underlined) 

Option 1 : 5 6  Option 2 : 1 5  Option 3 : 5 6  Option 4 : 1 5  


Ques 163 : Choose the correct answer  
A stack is implemented as a linear array A[0…N1]. Farhan writes the following functions for pushing an element E in to the stack. function PUSH( top, E, N ) { if(X) { top= top+1 A[top] = E } else { print “Overflow” } return top }Fill in the condition X 

Option 1 : top< N  Option 2 : top  Option 3 : top > 0  Option 4 : top > 1  


Ques 164 : Choose the correct answer  
A stack is implemented as a linear array A[0…N1]. Noor writes the following functions for popping an element from the stack. function POP( top, N ) { if(X) { top = top – 1 } else { print “Underflow” } return top }Fill in the condition X 

Option 1 : top< N1  Option 2 : top  Option 3 : top>1  Option 4 : top >= 0  


Ques 165 : Choose the correct answer  
Q is an empty queue. The following operations are done on it: ADD 5 ADD 7 ADD 46 DELETE ADD 13 DELETE DELETE ADD 10 What will be the content of Q after these operations. Front is marked by (F) and Rear is marked by (R). 

Option 1 : 10(R) 13(F)  Option 2 : 5(R) 10(F)  Option 3 : 13(R) 10(F)  Option 4 : 10(R) 5(F)  


Ques 166 : Choose the correct answer  
A queue is implemented as a (singly linked) linkedlist for easy addition and deletion of elements. Each node has an element and pointer to another node. Which node will point to empty/no location?  
Option 1 : Front  Option 2 : Rear  Option 3 : Both  Option 4 : None of these  


Ques 167 : Choose the correct answer  
A stack is implemented as a (singlylinked) linkedlist, where each node contains data and address of another node. The top node will contain the address of which node?  
Option 1 : No node. It will be empty  Option 2 : The node containing the first element pushed into the stack.  Option 3 : The node containing the element which was pushed just before the top element.  Option 4 : None of these  


Ques 168 : Choose the correct answer  
A queue is implemented by a linear array of size 10 (and not as a circularly connected array). Front and Rear are represented as an index in the array. To add an element, the rear index is incremented and the element is added. To delete an element, the front index is incremented. The following operations are done on an empty queue. ADD 1; DELETE; ADD 2; ADD 3; ADD 4; DELETE, DELETE After this set of operations, what is the maximum capacity of the queue? 

Option 1 : 6  Option 2 : 7  Option 3 : 10  Option 4 : None of these  


Ques 169 : Choose the correct answer  
A queue is implemented as a (singly linked) linkedlist. Each node has an element and pointer to another node. Rear and Front contain the addresses of the rear and front node respectively. If the condition (rear isequal front) is true and neither is NULL, what do we infer about the linked list?  
Option 1 : It has no elements  Option 2 : It has one element  Option 3 : There is an error  Option 4 : None of these  


Ques 170 : Choose the correct answer  
Jaswinder has a book of tickets and wants to store ticket numbers in a data structure. New tickets are added to the end of the booklet. Ticket at the top of the stack is issued to the customer. Which data structure should Jaswinder use to represent the ticket booklet?  
Option 1 : Queue  Option 2 : Stack  Option 3 : Array  Option 4 : Graph 