Advanced Data Structures Mid - I, September - 2014

1.An Algorithm must be always
  • Terminate
  • Executable
  • Well-ordered
  • ALL
Answer: D
2._______ a node means adding it to a list, but not necessarily to the end
  • Inserting
  • deleting
  • updating
  • None
Answer: A
3.Each generic type in a template function definition is preceded by the keyword
  • type
  • class
  • function
  • template
Answer: B
4.Transferring the values from the user to a variable, or vice-versa is
  • Function
  • Algorithm
  • Expression
  • All
Answer: A
5.What is the output of the following code?
#include<iostream.h>
void main() {
bool a=10;
cout<<a<<endl; }
  • 10
  • false
  • 1
  • Error
Answer: C
6.Which one of the following is the simplest data structure
  • Tree
  • Linked List
  • Array
  • Struct
Answer: C
7.Average and worst case complexity of Binary search is
  • O(log n)
  • O(n)
  • O(2n)
  • O(n2)
Answer: A
8.Run Time Polymorphism is achieved by
  • friend function
  • virtual function
  • operator overloading
  • function overloading
Answer: B
9.The ___________ step count is the maximum number of steps that can be executed for the given parameters.
  • worst-case
  • average-case
  • best-case
  • None
Answer: A
10.Separate Chaining in Hashing can also be known as
  • Linear Probing
  • Open Hashing
  • Open addressing
  • Closed Hashing
Answer: B
11.Extend STL ________________
Answer: Standard Template Library
12.After creating a linked list’s head pointer, one should make sure it points to __________ before using it in any operations.
Answer: NULL
13.A file stream is an extension of a ______________ stream.
Answer: Console
14.A _______________ is a linear list in which additions and deletions take place at different ends.
Answer: Queue
15.The maximum number of nodes on any level i is _____________ where i >= 0
Answer: 2i
16.The two types of polymorphism is ____________ & ____________.
Answer: Run time and compile time
17.A ____________ is a linear list in which additions and deletions take place at the same end.
Answer: Stack
18.A ____________ is a special member function used to initialize the data members of a class.
Answer: Constructor
19.The size of a class with no data members and member functions is _____________ bytes.
Answer: 1
20.An “is a” relationship between classes represent ______________.
Answer: Inheritance