ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!

  • google app store apple app store
  • тЬЦ

      Question

      What is the time complexity for performing enqueue and

      dequeue operations on a queue implemented using a linked list?
      A O(n) for both Correct Answer Incorrect Answer
      B O(log n) for both Correct Answer Incorrect Answer
      C O(1) for both Correct Answer Incorrect Answer
      D O(1) for enqueue, O(n) for dequeue Correct Answer Incorrect Answer
      E O(n) for enqueue, O(1) for dequeue Correct Answer Incorrect Answer

      Solution

      With proper pointers (head and tail), both enqueue (adding to tail) and dequeue (removing from head) operations in a linked list implementation of a queue can be achieved in constant time, O(1).

      Practice Next
      More IT Operating System Questions
      ask-question