MCQ STACK Queue
MCQ STACK Queue
3. Stack is used in
a) Recursion b) Invoking functions c) All of the above d) None of the above
10. Which of the following stack operations could result in stack underflow?
a) Is_empty b) Pop c) Push d) Two or
more of the above answers.
11. The postfix equivalent of the prefix *+ab-cd is
a) AB+CD-* b) abcd+-* c) ab+cd*- d) ab+-cd*
18. The number of elements that can be removed from the stack at any time is ………………
a) 3 b)4 c)1 d) 0
19. Suppose we have an array implementation of the stack structure, with ten items in the stack stored
at data[0] through data[9]. The CAPACITY is 42. Where does the push method place the new
entry in the array?
a) data[0] b) data[1] c) data[9] d) data[10]
20. Which data structure is used in evaluating mathematical expressions with parentheses?
a)Stack b) Queue c) Tree d) Graph
22. The five items A, B, C, D, E are pushed in a stack, one after the other starting from A. The stack
is popped four times and each element is inserted in a queue. Then two elements are deleted from
the queue and pushed back on the stack. Now one item is popped from the stack. The popped
item is
a) A b) B c) C d) D
23. Suppose you opened a notepad, a music player, an excel sheet, and also you are doing your data
structure programming simultaneously. Your OS implements which data structure for it.
a) Stack b) Queue c) Tree d) Linked List
24. Simulations are implemented using ______________________.
a) Stack b) Queue c) Linked List d) Tree
c) Queues use two ends of the structure; stacks use only one.
d) Stacks use two ends of the structure, queues use only one.
35. If the characters ‘D’, ‘C’, ‘B’, ‘A’ are placed in a queue (in that order), and then removed one at a
time, in what order will they be removed?
a) ABCD b) ABDC c) DCAB d) DCBA
40. If data is a circular array of CAPACITY elements, and rear is an index into that array, what is the
formula for the index after rear?
a) (rear % 1) + CAPACITY b) rear % (1 + CAPACITY)
c) (rear + 1) % CAPACITY d) rear + (1 % CAPACITY)
41. Suppose getFront is called on a priority queue that has exactly two entries with equal priority.
How is the return value of getFront selected?
a) One is chosen at random b) The one which was inserted first.
c) The one which was inserted most recently. d) This can never happen (violates the
precondition)
42. Queue is implemented with a linked list, keeping track of a front node and a rear node with two
reference variables. Which of these reference variables will change during an insertion into a
NONEMPTY queue?
a) Neither changes b) Only front changes c) Only rear changes. d) Both change
43. Which of the following data structure may give overflow error, even though the current number
of elements in it, is less than its size.
a) Simple queue b) Circular queue c) Stack d) None of the above.
44. A linear list in which elements can be added or removed at either end but not in the middle is
known as
a)Stack b) Queue c) Dequeue d) Heap
45. The initial configuration of queue a,b,c,d(‘a’ is at the front).To get the configuration d,c,b,a
One needs a minimum of
a) 2 deletions and 3 additions
b) 3 deletions and 2 additions
c) 3 deletions and 3 additions
d) 3 deletions and 4 additions
46. The rear and front end of a linear queue is used for
a) deletion, insertion b) searching, sorting c) insertion deletion d)none
47. Queue is implemented with a circular array, keeping track of front, rear, and manyItems (the
number of items in the array). Suppose front is zero, and rear is one less than the current capacity.
What can you tell me about many Items?
a) manyItems must be zero.
b) manyItems must be equal to the current capacity.
c) count could be zero or the capacity, but no other values could occur.
d) None of the above.