Wednesday, 27 November 2013

CS301-Data StcutureVU Solved Midterm Papers 2,quiz

MIDTERM EXAMINATION
Spring 2010
Question No: 1      ( Marks: 1 ) - Please choose one
Which one of the following statement is NOT correct .

►  In linked list the elements are necessarily to be contiguous           
►  In linked list the elements may locate at far positions in the memory In linked list each element also has the    next to it
In an array the elements are contiguous

Question No: 2      ( Marks: 1 ) - Please choose one
Each operator in a postfix expression refers to the previous ________ operand(s).
One
► Two   (Page 67)
Three
Four
Question No: 3      ( Marks: 1 ) - Please choose one
Which one of the following calling methods does not change the original value of the argument in the calling function?
None of the given options


► Call by passing the value of the argument
Call by passing reference of the argument
Call by passing the address of the argument
Question No: 4      ( Marks: 1 ) - Please choose one
A tree is an AVL tree if
Any one node fulfills the AVL condition



At least half of the nodes fulfill the AVL condition
► All the nodes fulfill the AVL condition         (Page 213)
► None of the given options
Question No: 5      ( Marks: 1 ) - Please choose one
Suppose currentNode refers to a node in a linked list (using the Node class with member variables called data and nextNode). What statement changes currentNode so that it refers to the next node?
currentNode ++;
currentNode = nextNode;
currentNode += nextNode;
► currentNode = currentNode->nextNode;



Question No: 6      ( Marks: 1 ) - Please choose one
A queue where the de-queue operation depends not on FIFO, is called a priority queue
False
► True       (Page 101)
Question No: 7      ( Marks: 1 ) - Please choose one
Which one is a self- referential data type?
Stack
Queue
► Link list
► All of these          
Question No: 8      ( Marks: 1 ) - Please choose one
Each node in doubly link list has,
1 pointer
► 2 pointers        (Page 39)
3 pointers
4 pointers
Question No: 9      ( Marks: 1 ) - Please choose one
I have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. Which of these pointers will change during an insertion into an EMPTY queue?
Neither changes
Only front pointer changes.
► Only rear pointer changes.
Both change.
Question No: 10      ( Marks: 1 ) - Please choose one
Consider the following tree.
How many of the nodes have at least one sibling?



8
7
► 5
► 6
A sibling is an element that shares the same parent with another element
Question No: 11      ( Marks: 1 ) - Please choose one
The nodes with no successor are called _________
Root Nodes
► Leaf Nodes
Both of these
None of these
Question No: 12      ( Marks: 1 ) - Please choose one
AVL Tree is,
► Non Linear data structure  
Linear data structure
Hybrid data structure (Mixture of Linear and Non Linear) None of the given options.
Question No: 13      ( Marks: 1 ) - Please choose one
We access elements in AVL Tree in,
Linear way only
► Non Linear way only
Both linear and non linear ways
None of the given options.
Question No: 14      ( Marks: 1 ) - Please choose one
A binary search tree should have minimum of one ________ node/s at each level,
► One
► Two              
Three
Four
Question No: 15      ( Marks: 1 ) - Please choose one
Consider the following statements.

(i)   A binary tree can contain at least 2L Nodes at level L.
(ii)  A complete binary tree of depth d is a binary tree that contains 2L Nodes at each level L between 0 and d,
      
both inclusive.
(iii) The total number of nodes (Tn ) in a complete binary tree of depth d is 2 d+1 - 1 .
(iv) The height of the complete binary tree can be written as h = log 2 (Tn+1)-1 where Tn is Total number of
       Nodes.



Which one of the following is correct in respect of the above statements regarding the Binary trees?
(i) and (iii) only
(i), (ii) and (iii) only
(ii) and (iii) only
(ii), (iii) and (iv) only        
Question No: 16      ( Marks: 1 ) - Please choose one
“+” is a _________operator.
Unary
► Binary     
Ternary

None of the above 

CS301-Data StcutureVU Solved Midterm Papers

MIDTERM EXAMINATION
Spring 2010
Question No: 1    ( M a r k s: 1 )
A subscript of an array may be an integer or an integer expression.
► True    
► False
Question No: 2    ( M a r k s: 1 )
Doubly Linked List always has one NULL pointer.
► True
► False      (Page 43)
Question No: 3    ( M a r k s: 1 )
In which of the traversal method, the recursive calls can be used to traverse a binary tree   ?
►  In preorder traversal only         (Page 143)
►  In inorder traversal only
►  In postorder traversal only
►  All of the given options
Question No: 4    ( M a r k s: 1 )
A tree is an AVL tree if
► Any one node fulfills the AVL condition
► At least half of the nodes fulfill the AVL condition
► All the nodes fulfill the AVL condition          (Page 213)
► None of the given options



Question No: 5    ( M a r k s: 1 )
Suppose currentNode refers to a node in a linked list (using the Node class with member variables called data and nextNode). What boolean expression will be true when cursor refers to the tail node of the list?
► (currentNode == null)
► (currentNode->nextNode == null)
► (nextNode.data == null)
► (currentNode.data == 0.0)
Question No: 6    ( M a r k s: 1 )    - Please choose one
Suppose that the class declaration of SomeClass includes the following function prototype. bool LessThan( SomeClass anotherObject );
Which of the following tests in the client code correctly compares two class objects alpha and beta?
► if (alpha < beta)
► if (alpha.LessThan(beta))        
► if (LessThan(alpha, beta))
► if (LessThan(alpha).beta)
Question No: 7    ( M a r k s: 1 )
In C what is the operation that you can not do with primitive types? ► Assign a value to primitive type using a literal
► Declare primitive types to be constant using the Const keyword
► Create a new instance of primitive type with New keyword        
► None of these
Question No: 8    ( M a r k s: 1 )
The operation for adding an entry to a stack is traditionally called : ► add
► append
► insert
► push         (Page 53)
Question No: 9    ( M a r k s: 1 )
The operation for removing an entry from a stack is traditionally called: ► delete
► peek
► pop       (Page 53)
► remove
Question No: 10    ( M a r k s: 1 )
Consider the following sequence of push operations in a stack:
stack.push(’7’);
stack.push(’8’);
stack.push(’9’);
stack.push(’10’);
stack.push(’11’);
stack.push(’12’);



► 7 8 9 10 11 12
► 9 8 11 10 7 12
► 9 10 8 11 12 7
► 9 10 8 12 7 11
Question No: 11    ( M a r k s: 1 )
________ is the maximum number of nodes that you can have on a stack-linked list ? ► Zero
► 2n (where n is the number of nodes in linked list)
► Any Number        
► None of these
Question No: 12    ( M a r k s: 1 )
Which of the following can be used to reverse a string value,
► Stack         
► Queue
► Both of these
► None of these
Question No: 14    ( M a r k s: 1 )
AVL Tree is,
► Non Linear data structure         
► Linear data structure
► Hybrid data structure (Mixture of Linear and Non Linear) ► None of the given options.
Question No: 15    ( M a r k s: 1 )
The following are statements related to queues.
(i)      The last item to be added to a queue is the first item to be removed (ii)  A queue is a structure in which both ends are not used
(iii) The last element hasn’t to wait until all elements preceding it on the queue are removed (iv)A queue is said to be a last-in-first-out list or LIFO data structure.
Which of the above is/are related to normal queues?
► (iii) and (ii) only
► (i), (ii) and (iv) only
► (ii) and (iv) only
► None of the given options        
Question No: 16    ( M a r k s: 1 )
An array is a group of consecutive related memory locations.
► True         

► False