![]() |
VOOZH | about |
Question 1
The minimum number of stacks needed to implement a queue is
3
1
2
4
Question 2
Consider the following statements:
i. First-in-first out types of computations are efficiently supported by STACKS.
ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations.
iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices.
iv. Last-in-first-out type of computations are efficiently supported by QUEUES.
Which of the following is correct?
(ii) is true
(i) and (ii) are true
(iii) is true
(ii) and (iv) are true
Question 3
A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let n denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' be implemented by deletion of a node from the tail.
Which one of the following is the time complexity of the most time-efficient implementation of 'enqueue' and 'dequeue, respectively, for this data structure?
Θ(1), Θ(1)
Θ(1), Θ(n)
Θ(n), Θ(1)
Θ(n), Θ(n)
Question 4
Circular queue is also called -----.
Ring Buffer
Rectangular Buffer
Square Buffer
None
Question 5
Given a queue with a linked list implementation. the Rear pointer points to the rear node of the queue. and the front node of the queue points to the front node of the queue, Which of the following operations is impossible to do in O(1) time?
Delete the front item from the list.
Delete the rear from the list.
insert at the front of the list.
None
Question 6
What is wrong in the below code of printing Right View of a binary tree using the Queue data structure?
We have not initialized anything in the Queue
Queue will never be empty.
left and right nodes of the tree are null.
None
Question 7
Which of the following is the type of priority Queue?
Ascending Order Priority Queue
Descending order Priority Queue
Deque
Both A and B.
Question 8
which data structure is used to implement deque?
Stack
Doubly linked list
circular array
Both B and C
Question 9
Which of the following is/are advantages of circular Queue?
Memory Management
Traffic system
CPU Scheduling
All of the above
Question 10
Consider the below program, and identify what the function is doing.
In order traversal of a tree
Normal traversal of a tree
Level order traversal of a tree
None
There are 30 questions to complete.