Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
719 views
in Information Technology by (101k points)
closed by
Typical time requirement for operations on queues is:
1. O(1)
2. O(n)
3. O(logn)
4. O(n2)

1 Answer

0 votes
by (102k points)
selected by
 
Best answer
Correct Answer - Option 1 : O(1)

Typical time requirement for operations on queues is O(1)

Insertion

Insertion operation in a queue, a new node is added, new node points to rear pointer of the queue and the rear pointer points to new node; This operation takes a constant amount of time, Therefore, the complexity of insertion in the queue is O(1).

Deletion

Deletion operation in a queue, element to be deleted is a front element, address of the front pointer is stored in a temporary variable, the front pointer points to its immediate next node and location stored in a temporary variable is free; This operation takes a constant amount of time, Therefore, the complexity of insertion in a queue is O(1)

  • Queue is data structure which is First in First Out (FIFO) or Last in Last Out (LILO) which means the element which is inserted first comes out first form the queue or the elements inserted last comes out last from the queue
  • Breadth First Search (BFS) algorithm traverses a graph in a breadthwise manner and uses a queue to remember to get the next vertex to start a search, when a dead end occurs in any iteration.

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...