Data Structures :: Queue

Home > Technical Aptitude > Data Structures > Queue > General Questions

NA
SHSTTON
136
Solv. Corr.
34
Solv. In. Corr.
170
Attempted
0 M:12 S
Avg. Time

1 / 15

Choose the correct option.

How is Data in a queue accessed


AFirst in First out

BFirst in last out

CLast in First out

DNone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
340
Solv. Corr.
70
Solv. In. Corr.
410
Attempted
0 M:28 S
Avg. Time

2 / 15

Choose the correct option.

Item in priority queue can jump to the front on the line if they have priority


ATRUE

BFALSE

CNone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

A priority queue is similar to a simple queue in that items are organized in a line and processed sequentially. However, items on a priority queue can jump to the front of the line if they have priority. Priority is a value that is associated with each item placed in the queue.

Workspace

NA
SHSTTON
295
Solv. Corr.
98
Solv. In. Corr.
393
Attempted
0 M:20 S
Avg. Time

3 / 15

Choose the correct option.

The dequeue process removes data from the front of the single ended queue


ATRUE

BFALSE

CNone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
75
Solv. Corr.
295
Solv. In. Corr.
370
Attempted
0 M:12 S
Avg. Time

4 / 15

Choose the correct option.

Time taken for addition of element in queue is


AO(1)

BO(n)

CO(log n)

DNone of these options

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option C

Explanation:

I think this answer should be A. O(1). because this question is asked about the normal queue.



For priority queue this should be O(log n).

Workspace

NA
SHSTTON
249
Solv. Corr.
87
Solv. In. Corr.
336
Attempted
2 M:38 S
Avg. Time

5 / 15

Choose the correct option.

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


Aqueue.

Bstack.

Ctree.

Dlinked list.

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
204
Solv. Corr.
122
Solv. In. Corr.
326
Attempted
0 M:14 S
Avg. Time

6 / 15

Choose the correct option.

The data structure required for Breadth First Traversal on a graph is


Aqueue

Bstack

Carray

Dtree

Answer: Option A

Explanation:

queue is not a graph type, is a linear type, but how can it answer


Workspace

NA
SHSTTON
139
Solv. Corr.
136
Solv. In. Corr.
275
Attempted
0 M:35 S
Avg. Time

7 / 15

Choose the correct option.

Let the following circular queue can accommodate maximum six elements with the following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?


Afront = 2 rear = 5 queue = ______; L, M, N, O, ___

Bfront = 3 rear = 5 queue = L, M, N, O, ___

Cfront = 3 rear = 4 queue = ______; L, M, N, O, ___

Dfront = 2 rear = 4 queue = L, M, N, O, ___

Answer: Option A

Explanation:

Because Queue is FIFO so when we add 0 its obvious that it will come after N at position 5.


2. L

3.M

4.N

and when add o in this Queue as its FIFO it comes at position 5

5.O

6.

Workspace

NA
SHSTTON
283
Solv. Corr.
13
Solv. In. Corr.
296
Attempted
0 M:0 S
Avg. Time

8 / 15

Choose the correct option.

A queue is a,


AFIFO (First In First Out) list.

BLIFO (Last In First Out) list.

COrdered array.

DLinear tree.

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
181
Solv. Corr.
101
Solv. In. Corr.
282
Attempted
0 M:0 S
Avg. Time

9 / 15

Choose the correct option.

6, 8, 4, 3, and 1 are inserted into a data structure in that order. An item is deleted using only a basic data structure operation. If the deleted item is a 1, the data structure cannot be a ?


AQueue

BTree

CStack

DHash Table

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
15
Solv. Corr.
245
Solv. In. Corr.
260
Attempted
0 M:0 S
Avg. Time

10 / 15

Choose the correct option.

We need to implement a queue using a circular array. If DATA is a circular array of CAPACITY elements, and rear is an index into that array, what will be the index for the element after rear?


A(rear + 1) % CAPACITY

Brear + (1 % CAPACITY)

Crear % (1 + CAPACITY)

D(rear % 1) + CAPACITY

Answer: Option D

Explanation:

option A should be correct, modulus of a will always be zero in case of integer value.

Workspace