Monday, 16 October 2017

Multiple Choice Questions on Data Structure and Algorithm Design

Q1. The validity of an expression containing nested parentheses could be checked using which of the following:
a: linked list
b: stack
c: tree
d: Queue

Q2. A string data structure could be reversed using which of the given data-structure:
a: stack
b: queue
c: tree
d: linked list

Q3. The arithmetic notation in which the operator occurs between the operands is known as:
a: infix notation
b: prefix notation
c: postfix notation
d: post-operator notation


Q4. In a queue, the underflow condition occurs when rear = ?:
a: rear=max -1
b: front= -1
c: rear=front
d: rear=size-1

Q5. In a circular queue, one of the conditions when overflow occurs when:
a: rear=size-1
b: rear=front
c: (rear+1)=front
d: front=-1

Q6. In postfix expression, the operator is placed:
a: between the operands           
b: after the operands
c: before the operands
d: none of these

Q7. In a priority queue, data elements with the same priority are processed according to which rules:
a: First come first served basis
b: priority
c: last in first come basis
d: no specific order

Q8. Deque in which insertion is done at one end and deletion from both ends is known as:
a: input-restricted deque
b: output-restricted deque
c: input-output restricted deque
d: Any of the above

Q9. A circular array queue with space for 15 elements in which front =10 and rear=14, insertion of next element will take place at position:
a: 0      
b: 11
c: 15
d: insertion can not take place due to overflow situation

Q10. Data-structure in which every data element is assigned a priority and the elements are added or deleted according to that priority is known as:
a: priority list
b: priority queue
c: stack
d: none of the above

Q11. Linear data-structure in which data elements could be inserted or deleted at either end but not in the middle is known as:
a: queue
b: stack
c: deque
d: circular queue

Q12.  Circular queue with 10 elements, if front is at 9 and rear at 4, the deletion of an element will make front point to which position:
a: 0
b: -1
c: 3
d: 5

Q13. A non-linear hierarchical type of data-structure is known as which of the following:
a: graph
b: tree
c: array
d: deque

Q14. All leaf nodes of a tree are termed as:
a: terminal nodes
b: non-terminal nodes
c: child nodes
d: internal nodes

Q15.The root node is 
a: terminal node
b: internal nodes
c: child node
d: none of the above

Q16. The nodes belonging to the same parent are known as:
a: descendants
b: external nodes
c: child nodes
d: siblings

Q17. A tree in which the degree of each node is either 0 or 2:
a: complete binary tree
b: binary search tree
c: strictly binary tree     
d: none of the above

Q18. A binary tree in which all the leaf nodes of the tree are at the same level:
a: complete binary tree
b: binary search tree
c: strictly binary tree
d: none of the above

Q19. At any level n of a binary tree, the maximum number of nodes are:
a. 2n
b: 2*n
c: 2/n
d: n+2

Q20. What is the root node for the algebraic expression : a*(b+c)-d, if it is represented in the form of a tree:
a: -
b: %
c: +
d: *


Thanks
Mukesh Rajput

No comments:

Post a Comment

Thanks
Mukesh Rajput