###### Process-Scheduling

October 2, 2023###### GATE 2017 [Set-1]

October 3, 2023# Data-Structures

Question 3 |

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efﬁciently. Which one of the following statements is **CORRECT** (*n* refers to the number of items in the queue)?

Both operations can be performed in O(1) time | |

At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n) | |

The worst case time complexity for both operations will be Ω(n) | |

Worst case time complexity for both operations will be Ω(logn) |

Question 3 Explanation:

Since it is mentioned in the question that both of the operations are performed efficiently.

Hence even the worst case time complexity will be O(1) by the use of the Circular queue there won’t be any need of shifting in the array.

Hence even the worst case time complexity will be O(1) by the use of the Circular queue there won’t be any need of shifting in the array.

Correct Answer: A

Question 3 Explanation:

Since it is mentioned in the question that both of the operations are performed efficiently.

Hence even the worst case time complexity will be O(1) by the use of the Circular queue there won’t be any need of shifting in the array.

Hence even the worst case time complexity will be O(1) by the use of the Circular queue there won’t be any need of shifting in the array.

Subscribe

Login

0 Comments