# VU CS301 -Data Structure MIDTERM Solved/Unsolved Papers Spring 2012

MIDTERM EXAMINATION

Spring 2012

Question No: 1      ( Marks: 1 ) – Please choose one

Which one of the following statement is NOT correct .

►  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

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,

► 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

► 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

Question No: 16      ( Marks: 1 ) – Please choose one

“+” is a _________operator.

► Unary

► Binary         (Page 64)

► Ternary

► None of the above