Respuesta :

Enque and deque operations on a singly-linked list based queue should both have constant time, or O(1), if carried out properly .

A linear data structure called a queue employs the FIFO method (First In First Out). A line of people waiting sequentially, commencing at the front of the line, might be thought of as a queue. It is an ordered list where deletions are made from the front and insertions are made from the rear end, which is known as the list's end. You can implement a queue using an array or a linked list.

The measurement of how long it takes for an algorithm or piece of code to run is known as time complexity. The efficiency can also be measured by the time complexity.

An operation is deemed to be constant time, if it continuously uses the same number of fundamental operations to produce the desired result, provided there are no variable-length loops or recursion.

In order to avoid traversing the list, which takes O(N) time and is not constant, you must keep a pointer to both the head and tail of the linked list.

To learn more about singly-linked list click here:

brainly.com/question/29306616

#SPJ4

ACCESS MORE