1.

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 queueMy question is taken from Queue using Linked List topic in portion Abstract Data Types of Data Structures & Algorithms II got this question during an interview for a job.

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.


Discussion

No Comment Found

Related InterviewSolutions