Wednesday, 3 February 2016

Data Structure - Quiz

Q.1 Total number of instruction executed in the worst case is n^2+4n-4 time complexity of the algorithm is in
A. theta(n^2)
B. O(n^2)
C. O(n)
D.theta(n)
Ans � A

Q.2The algorithm which compares all element one by one and sort them on the basis of their values is called
A. Quick sort
B. Bubble sort
C. Merge sort
D. heap sort
Ans � B

Q.3For performing enqueue we require how many stack/s?
A. one
B. two
C. three
D. four
Ans � A

Q.4For the given algorithm
for(i=0; i < N; i++)
{
  statement;
}
The time complexity will be
A. Linear
B. Constant
C. Quadratic
D. Logarithmic
Ans � A



Q.5For the given algorithm
while(low <= high) 
{
  mid = (low + high) / 2;
  if (target < list[mid])
    high = mid - 1;
  else if (target > list[mid])
    low = mid + 1;
  else break;
}
The time complexity will be
A. Linear
B. Constant
C. Quadratic
D. Logarithmic
Ans � D

Q.6For the given algorithm
for(i=0; i < N; i++) 
{
  for(j=0; j < N;j++)
  { 
    statement;
  }
}
The time complexity will be
A. Linear
B. Constant
C. Quadratic
D. Logarithmic
Ans � C

Q.7_____ is the set of functions that grow slower than or at the same rate as expression.
A. Theta(expression) 
B. Omega(expression) 
C. O(expression)
D. None of the above
Ans � C

Q.8 ________consist of all the functions that lie in both O(expression) and Omega(expression).
A. Theta(expression) 
B. Omega(expression) 
C. O(expression)
D. None of the above
Ans � A

Q.9 Integer, Float, Boolean, Char are
A. Primptive data structure
B. Abstract data structure
C. Non primptive data structure
D. Flow Chart
Ans- A

Q.10 The space required to store the executable version of the program.
A. Data Space
B. Instruction Space
C. Environment Space
D. Program Space
Ans � B






No comments:

Post a Comment