Data Structures through C++ Mid - I, September - 2010

1.C encourages structuring a software as a collection of components that are
  • highly cohesive and loosely coupled
  • loosley cohesive and loosely coupled
  • highly cohesive and highly coupled
  • highly cohesive and highly coupled
Answer: A
2.Reusability is a desirable feature of a language as it
  • decreases the maintenance cost
  • decreases the testing time
  • both a and b
  • none
Answer: C
3.The fields in a structure of a (C ) program are by default_______.
  • public
  • private
  • protected
  • none
Answer: A
4.Transforming a C source file into an executable file requires ____ steps.
  • two
  • three
  • one
  • four
Answer: A
5.Overloaded functions
  • are group of functions with the same name and arguments.
  • are group of functions with the same name and different arguments.
  • are group of functions with different name and different arguments.
  • are group of functions with different name and same arguments.
Answer: B
6.The statements
int a=35;
cout <<''FIRST''<<(a<<2)<<''SECOND'';
outputs
  • FIRST120SECOND
  • FIRST110SECOND
  • FIRST140SECOND
  • FIRST130SECOND
Answer: C
7.The body of a function is surrounded by____
  • {----}
  • [-----]
  • /-----/
  • /*-----*/
Answer: A
8.Which of the following can not be declared static?
  • variable
  • function
  • object
  • method
Answer: C
9.In hashing by division the hash function has the form_____
  • f(k)=K%(d-1)
  • f(k)=(K+1)%(d+1)
  • f(k)=(k-1)%d
  • f(k)=k%d
Answer: D
10.In division hash function , in the hash table of length 11 we can place the value 80 at _____position.
  • 5
  • 8
  • 3
  • 10
Answer: C
11._______ feature of OOPS is used to define new datatypes
Answer: overloaded
12.The two key concepts in OOP are__________ .
Answer: objects and classes
13.The key terms in describing the object oriented language________.
Answer: Data encapsulation and Data hiding.
14.__________ occurs when there isn't room i n the home bucket for the new pair
Answer: Overflow
15.The asymptotic analysis focuses on determining _______terms in the complexity function
Answer: biggest
16.The data space is needed store_________
Answer: all constants and variable values
17.Consider the following program code
static char =x[3]=3D''1234'';
cout << x ;
Complete C programs with these two statements will give_____ error.
Answer: will give a compilation error
18._________ specifiers need not be honored by the compiler.
Answer: inline
19.The c memory allocation function is________.
Answer: new
20.A constructor is called whenever_______ is declared.
Answer: an object is declared