+1 vote
in Data Structures & Algorithms I by (110k points)
In linked list implementation of queue, if only front pointer is maintained, which of the following operation take worst case linear time?

(a) Insertion

(b) Deletion

(c) To empty a queue

(d) Both Insertion and To empty a queue

My question is taken from Queue using Linked List topic in portion Abstract Data Types of Data Structures & Algorithms I

I got this question during an interview for a job.

1 Answer

+1 vote
by (412k points)
selected by
Best answer
Right option is (d) Both Insertion and To empty a queue

The best I can explain: Since front pointer is used for deletion, so worst time for the other two cases.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.