NIELIT A Level July, 2011
A6-R4: DATA STRUCTURE THROUGH C++
PART ONE
(Answer all the questions)
1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)
1.1 Identify the incorrect statement.
A) The resources most relevant in relation to efficiency are CPU time and internal memory.
B) An algorithm cannot have same Big-O measure for the worst case and the best case.
C) Worst case complexity of an algorithm can be determined by choosing a set of input conditions
that force the algorithm to make the least possible progress towards its final goal at each step.
D) Algorithms having exponential complexity can be practically solved only for very small values
of n.
1.2 The correct ADT of pop operation of a stack is
A) Function: Adds newItem to the top of stack
Precondition: Stack has been initialized
Postcondition: If (stack is full), exception fullStack is thrown,
else newItem is at the top of the stack
B) Function: Adds newItem to the top of stack
Precondition: Stack has been initialized
Postcondition: If (stack is empty), exception emptyStack is thrown,
else top element is removed from the stack
C) Function: Removes top element from the stack
Precondition: Stack has been initialized
Postcondition: If (stack is empty), exception emptyStack is thrown,
else top element is removed from the stack
D) Function: Removes top element from the stack
Precondition: Stack has been initialized
Postcondition: If (stack is full), exception FullStack is thrown,
else newItem is at the top of the stack