DATA STRUCTURE UNIT-2 QUIZ
Questions:-
1.It is linear data structure in which addition
or deletion of elements takes place at
same end is known as:
A) Linked list
B) Array
C) Stack
D) Queue
2. Find one of the applications of stack in
the following:
A) Implementation of stacks and queues.
B) Reversing a List
C) Traversal of an array
D) Maintaining directory of names.
3. It is a linear list in which elements can be
added or removed at either end but not
in the middle.
A) Enqueue
B) Dequeue
C) Circular queue
D) None of the above
4. The collection of elements where each
element is assigned a priority and the
order in which elements are deleted and
processed is known as
A) Enqueue
B) Dequeue
C) Circular queue
D) Priority queue
5. It is implemented in circular form rather
than in a straight line. It overcomes the
problem of unutilized space in linear
queue implemented as an array.
A) Circular linked list
B) Doubly linked list
C) Circular queue
D) None of the above
6. Which one of the following is an
application of Queue Data Structure:
A) When a resource is shared among multiple consumers.
B) When data is transferred asynchronously between two processes
C) Load Balancing
D) All of the above
7.How many stacks are needed to
implement a queue.
A) 1
B) 2
C) 3
D) 4
8. The operation of adding item in a stack is
called as
A) Push operation
B) Pop operation
C) Insert operation
D) Delete operation
9. How many functions does a dynamic
memory allocation have ?
A) 1
B) 2
C) 3
D) 4
10.How many queues are needed to
implement a stack:
A) 1
B) 2
C) 3
D) 4
11) How many expressions are available in
Stack:
Case 1: infix
Case 2: prefix
Case 3: postfix
A) Case 2&3 are correct.
B) Case 1&3 are correct.
C) Case 2&3 are correct but case 1 is wrong.
D) All cases are true.
12. Stack is:
A)
B) Static data structure
C) Dynamic data structure
D) Inbuilt data structure
E) None of these
13. Which of the following is true about
linked list implementation of stack?
A) In push operation, if new nodes are inserted at the beginning of linked list, then in
pop operation, nodes must be removed from end.
B) In push operation, if new nodes are inserted at the end, then in pop operation,
nodes must be removed from the beginning.
C) Both of the above
D) None of the above
14. When a stack is empty and an attempt is
made to delete an element from the
STACK is called:
A) Upper flow
B) Under flow
C) Over flow
D) Higher flow
15. Stack is implemented in which manner:
A) FIFO
B) FILO
C) LILO
D) LIFO
16. Stack is useful in implementing:
A) Radix
B) Breath first search
C) Recursion
D) None of the above
17. Push operation in stack may result in:
A) Upper flow
B) Under flow
C) Over flow
D) Higher flow
18. Among the given cases which is the
correct one?
Case1: "Parentheses are never needed
in prefix or postfix expressions".
Case 2:" push operation in stack may
result in over flow"
A) Case 1 is true but case 2 is false.
B) Case 1 is false but case 2 is true.
C) Both case 1 and case 2 is false.
D) Both case 1 and case 2 is true.
19. The time required to insert an element in
a stack with linked implementation is:
A) 0(1)
B) 0(logn)
C) 0(n)
D) 0(n logn)
20. Using arrays the most efficient
implementation of queue is on:
A) Linear queue
B) Priority queue
C) Circular queue
D) None of these
21. Queue serves a major role in:
A) Simulation of recursion
B) Simulation of arbitrary linked list
C) Simulation of linked resource allocation
D) None of these
22. It is appropriate to represent a queue
as:
A) A circular list
B) Doubly linked list
C) Linear linked list
D) Array
23. A data structure in which Insertion and
deletion can take place at both ends is
called:
A) Dequeue
B) Stack
C) Circular queue
D) None of these
24. Which dequeue allows deletions at only
one end of the list but allows insertions
at both ends of the list:
A) Input-restricted dequeue
B) Output-restricted dequeue
C) Both A&B
25. Riddle:-
"It is a type of queue where you cannot
add elements in middle"
A) Enqueue
B) Dequeue
C) Linear queue
D) Non linear queue
Answers:-
1) Stack (c)
2) Reversing a list (b)
3) Dequeue (b)
4) Priority queue (b)
5) Circular queue (c)
6) All of the above (d)
7) 2 (b)
8) Push operation (a)
9) 4 (d)
10) 2 (b)
11) All cases are true (d)
12) Dynamic data structure (b)
13) None of the above (d)
14) Under flow (b)
15) LIFO (d)
16) Recursion (c)
17) Over flow (c)
18) Both case 1 and case 2 is true (d)
19) 0(1) (a)
20) Circular queue (c)
21) Simulation in linked resource allocation (c)
22) circular linked list (a)
23) Dequeue (a)
24) Output restricted dequeue (b)
25) Dequeue (b)