1)Process of inserting an elements at the end of queue is known as?
a)Dequeue
b) Enqueue
c)Push
d) Pop
Ans:b(Enqueue)
2) Returns the element at front without removing it
a) Enqueue
b) Dequeue
c) int Front()
d) None of these
Ans:c(int Front())
3) The maximum size of the queue ?
a) can be changed
b) cannot be change
c) independent
d) None of these
Ans:b(cannot be changed)
4) What is the most appropriate data structure to print elements of queue in reverse order?
a) Stack
b) List
c) Sorting
d) None of these
Ans:a(Stack)
5) Process of Dequeuing an empty queue is called
a) Underflow
b) Overflow
c) Skip lists
d) none of these
Ans:a(Underflow)
6) Process of Enqueuing an element in a full queue is called
a) Underflow
b) Overflow
c) Skip lists
d) None of these
Ans:b(Overflow)
7) A normal queue, if implemented using an array of size MAX_SIZE, gets full when
a) Rear=MAX_SIZE-1
b) Front=(rear+1)mod MAX_SIZE
c) Front=rear+1
d) Rear=front
Ans:a(Rear=MAX_SIZE-1
8) What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?
a) θ (n)
b) θ (n + k)
c) θ (nk)
d) θ (n2)
Ans:a(∅(n))
9) If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
a) ABCD
b) DCBA
c) DCAB
d) ABCD
Ans:a(ABCD)
10) A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?
a) Queue
b) Stack
c) Tree
d) Linked list
Ans:a(Queue)
11) Define circular queue.
Ans:A circular queue is one in which the insertion of a new element is done at the very first location of the queue if the last location of the queue is full.
12) Queue where insertion and deletion performed from both ends
a) Circular queue
b) Doubly circular queue
c) Double Ended queue
d) none of these
Ans:c(Double ended queue)
13) What is input restricted dequeue?
Ans:In input restricted dequeue , insertion can be done only in rear end whereas deletion can be done in both rear and front end.
14) Name dequeue in which insertion can be done from bith rear and front end.
a) Output restricted dequeue
b) Input restricted dequeue
c) Double ended queue
d) none of these
Ans:a(Output restricted dequeue)
15) Which function is used to return the value of first element without dequeueing it?
a) peek()
b) typedef
c) id
d) none of these
Ans:a(peek())
16) Define priority queue.
Ans:A priority queue is another variation of queue structure. Here, each element has been assigned a value, called priority of the element.
17) Name few ways of implementing structure of a priority queue.
Ans:
- Using a simple/circular array
- Multi-queue implementation
- Using a double linked list
- Using a heap tree
18) List few applications of queue.
Ans:
- It is used to schedule the jobs to be processed by the CPU.
- Surving request on the single shared resources like a printer, cpu, scheduling, etc.
- Breadth first search[BFS] uses a queue data structure to find an element from a graph.
19) push() and pop() functions are found in
a) queues
b) lists
c) stacks
d) trees
Ans:c(stacks)
20) Minimum number of queues required for priority queue implementation?
a) 5
b) 4
c) 3
d) 2
Ans:d(2)