Mid Term
1.

A queue where the delimiter -queue operation depends not on FIFO, is called a priority queue

A.  

False 

B.  

True

2.

The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should

A.  

Use better data structures 

B.  

Increase the hard disk space

C.  

Use the better algorithm

D.  

Use as much data as we can store on the hard disk

3.

Consider the function X as under 

int X (int& Value) 
{ 
return Value; 
} 

Now a and b are integers in a calling function. Which one of the following is a valid call to the above function X.

A.  

a = X (b) ;

B.  a = X (&b) ; C.  

a = X (*b) ;

D.  

None of the given optionions

4.

In the call by value methodology, a copy of the object is passed to the called function.

A.  

False

B.  

True

5.

The tree data structure is a

A.  

Linear data structure

B.  

Non-linear data structure

C.  

Graphical data structure

D.  Data structure like queue
6.

When should you use a const reference parameter?

A.  

Whenever the parameter has huge size.

B.  Whenever the parameter has huge size, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument. C.  

Whenever the parameter has huge size, the function changes the parameter within its body, and you DO  want these changes to alter the actual argument.

D.  

Whenever the parameter has huge size, and the function does not change the parameter within its body.

7.

Here is the start of a C++ class declaration: 

class foo 
     { 
  public: 
void x(foo f);
void y(const foo f); 
void z(foo f) const;

 Which of the three member functions can alter the PRIVATE member variables of the foo object that activates the function?

A.  

Only x can alter the private member variables of the object that activates the function.

B.  

Only y can alter the private member variables of the object that activates the function.

C.  

Only z can alter the private member variables of the object that activates the function.

D.  

Two of the functions can alter the private member variables of the object that activates the function.

8.

What is the maximum depth of recursive calls a function may make?

A.  

1

B.  

2

C.  

n (where n is the argument) 

D.  There is no fixed maximum
9.

Suppose n is the number of nodes in a complete Binary Tree then maximum steps required for a search operation are,

A.  

Log2 (n+1) -1 

B.  Log2 (n+1) C.  

Log2 (n)-1

D.  

Log2 (n)

10.

In the linked list implementation of the stack class, where does the push member function places the new entry on the linked list?

A.  

At the head

B.  

At the tail

C.  

After all other entries that are greater than the new entry.

D.  

After all other entries that are smaller than the new entry.