Вы находитесь на странице: 1из 3

3CSE Data Structure & Algorithm Quiz

1.Process of inserting an element in stack is called 8. What is the value of the postfix expression 6 3 2 4
____________ + – *:
a) Create a) 1
b) Push b) 40
c) Evaluation c) 74
d) Pop d) -18

2. Process of removing an element from stack is 9. The data structure required to check whether an
called __________ expression contains balanced parenthesis is?
a) Create a) Stack
b) Push b) Queue
c) Evaluation c) Array
d) Pop d) Tree

3.In a stack, if a user tries to remove an element 10. What data structure would you mostly likely see
from empty stack it is called _________ in a non recursive implementation of a recursive
a) Underflow algorithm?
b) Empty collection a) Linked List
c) Overflow b) Stack
d) Garbage Collection c) Queue
d) Tree
4. Pushing an element into stack already having five
elements and stack size of 5, then stack becomes 11. A linear collection of data elements where the
a) Overflow linear node is given by means of pointer is called?
b) Crash a) Linked list
c) Underflow b) Node list
d) User flow c) Primitive list
d) None of the mentioned
5. Entries in a stack are “ordered”. What is the
meaning of this statement? 12. In linked list each node contain minimum of two
a) A collection of stacks is sortable fields. One field is data field to store the data
b) Stack entries may be compared with the ‘<‘ second field is?
operation a) Pointer to character
c) The entries are stored in a linked list b) Pointer to integer
d) There is a Sequential entry that is one by one c) Pointer to node
d) Node
6. Which of the following applications may use a
stack? 13. The concatenation of two list can performed in
a) A parentheses balancing program O(1) time. Which of the following variation of linked
b) Tracking of local variables at run time list can be used?
c) Compiler Syntax Analyzer a) Singly linked list
d) Data Transfer between two asynchronous b) Doubly linked list
process c) Circular doubly linked list
d) Array implementation of list
7. Consider the usual algorithm for determining
whether a sequence of parentheses is balanced. 14. What kind of linked list is best to answer
The maximum number of parentheses that appear question like “What is the item at position n?”
on the stack AT ANY ONE TIME when the algorithm a) Singly linked list
analyzes: (()(())(())) are: b) Doubly linked list
a) 1 c) Circular linked list
b) 2 d) Array implementation of linked list
c) 3
d) 4 or more
15. Linked lists are not suitable to for the 22. Which of the following is a correct way to
implementation of? declare a multidimensional array in Java?
a) Insertion sort a) int[] arr;
b) Radix sort b) int arr[[]];
c) Polynomial manipulation c) int[][]arr;
d) Binary search d) int[[]] arr;

16.Linked list is considered as an example of 23. Which of the following concepts make extensive
___________ type of memory allocation. use of arrays?
a) Dynamic a) Binary trees
b) Static b) Scheduling of processes
c) Compile time c) Caching
d) None of the mentioned d) Spatial locality

17. In Linked List implementation, a node carries 24. What are the advantages of arrays?
information regarding a) Objects of mixed data types can be stored
a) Data b) Elements in an array cannot be sorted
b) Link c) Index of first element of an array is 1
c) Data and Link d) Easier to store elements of same data type
d) None of the mentioned
25. What are the disadvantages of arrays?
18. Linked list data structure offers considerable a) Data structure like queue or stack cannot be
saving in implemented
a) Computational Time b) There are chances of wastage of memory space
b) Space Utilization if elements inserted in an array are lesser than the
c) Space Utilization and Computational Time allocated size
d) None of the mentioned c) Index value of an array can be negative
d) Elements are sequentially accessed
19. Which of the following points is/are true about
Linked List data structure when it is compared with 26. Assuming int is of 4bytes, what is the size of int
array arr[15];?
a) Arrays have better cache locality that can make a) 15
them better in terms of performance b) 19
b) It is easy to insert and delete elements in Linked c) 11
List d) 60
c) Random access is not allowed in a typical
implementation of Linked Lists 27.A linear list of elements in which deletion can be
d) All of the mentioned done from one end (front) and insertion can take
place only at the other end (rear) is known as a ?
20. Which of the following is not a disadvantage to a) Queue
the usage of array? b) Stack
a) Fixed size c) Tree
b) there are chances of wastage of memory space if d) Linked list
elements inserted in an array are lesser than the
allocated size 28.A queue follows __________
c) Insertion based on position a) FIFO (First In First Out) principle
d) Accessing elements at specified positions b) LIFO (Last In First Out) principle
c) Ordered array
21. How do you initialize an array in C? d) Linear tree
a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3}; 29. Circular Queue is also known as ________
c) int arr[3] = {1,2,3}; a) Ring Buffer
d) int arr(3) = (1,2,3); b) Square Buffer
c) Rectangle Buffer
d) Curve Buffer
30. If the elements “A”, “B”, “C” and “D” are placed 38. Which data structure can be used to test a
in a queue and are deleted one at a time, in what palindrome?
order will they be removed? a) Tree
a) ABCD b) Heap
b) DCBA c) Stack
c) DCAB d) Priority queue
d) ABDC
39. What is the number of moves required in the
31. A data structure in which elements can be Tower of Hanoi problem for k disks?
inserted or deleted at/from both the ends but not in a) 2k – 1
the middle is? b) 2k + 1
a) Queue c) 2k + 1
b) Circular queue d) 2k – 1
c) Dequeue
d) Priority queue 40. When an operand is read, which of the following
is done?
32. A normal queue, if implemented using an array a) It is placed on to the output
of size MAX_SIZE, gets full when b) It is placed in operator stack
a) Rear = MAX_SIZE – 1 c) It is ignored
b) Front = (rear + 1)mod MAX_SIZE d) Operator stack is emptied
c) Front = rear + 1
d) Rear = front 41. What should be done when a left parenthesis ‘(‘
is encountered?
33. Queues serve major role in ______________ a) It is ignored
a) Simulation of recursion b) It is placed in the output
b) Simulation of arbitrary linked list c) It is placed in the operator stack
c) Simulation of limited resource allocation d) The contents of the operator stack is emptied
d) Simulation of heap sort
42. Which of the following is an infix expression?
34. Which of the following is not the type of queue? a) (a+b)*(c+d)
a) Ordinary queue b) ab+c*
b) Single ended queue c) +ab
c) Circular queue d) abc+*
d) Priority queue
43. Parentheses are simply ignored in the
35. What is a memory efficient double linked list? conversion of infix to postfix expression.
a) Each node has only one pointer to traverse the a) True
list back and forth b) False
b) The list has breakpoints for faster traversal
c) An auxiliary singly linked list acts as a helper list 44. It is easier for a computer to process a postfix
to traverse through the doubly linked list expression than an infix expression.
d) A doubly linked list that uses bitwise AND a) True
operator for storing addresses b) False

36. How many stacks are required for applying 45. What is the postfix expression for the following
evaluation of infix expression algorithm?
infix expression?
a) one
b) two a/b^c-d
c) three
d) four a)abc^/d-
b)ab/cd^-
37. Which data structure can be used suitably to
c)ab/^cd-
solve the Tower of Hanoi problem?
a) Tree d) abcd^/-
b) Heap
c) Priority queue
d) Stack

Вам также может понравиться