Homechevron_rightEngineeringchevron_rightComputer Sciencechevron_rightData Structurechevron_rightIf queue is implemented using arrays, what would be the worst run time...

If queue is implemented using arrays, what would be the worst run time...

  • Q. If queue is implemented using arrays, what would be the worst run time complexity of queue and dequeue operations?
  • filter_dramaExplanation
    Answer is : D
    None.

Discussion

    No one started the discussion yet. Break the ice and start the conversation.
    Please Login to be part of the discussion.

Similar Questions

  • 1. In linked list implementation of a queue, from where is the item deleted?
  • filter_dramaExplanation
    Answer is : A
    None.
  • 2. What is the time complexity to insert a node based on key in a priority queue?
  • filter_dramaExplanation
    Answer is : C
    None.
  • 3. Select the function which performs insertion at the front end of the dequeue?

    a)
    
    public void function(Object item)
    {
     Node temp = new Node(item,null);
     if(isEmpty())
     {
      temp.setNext(trail);
      head.setNext(temp);
     }
     else
     {
      Node cur = head.getNext();
      temp.setNext(cur);
      head.setNext(temp);
     }
     size++;
    }
    
    b)
    
    public void function(Object item)
    {
     Node temp = new Node(item,null);
     if(isEmpty())
     {
      temp.setNext(trail);
      head.setNext(trail);
     }
     else
     {
      Node cur = head.getNext();
      temp.setNext(cur);
      head.setNext(temp);
     }
     size++;
    }
    
    c)
    
    public void function(Object item)
    {
     Node temp = new Node(item,null);
     if(isEmpty())
     {
      Node cur = head.getNext();
      temp.setNext(cur);
      head.setNext(temp);
     }
     else
     {
      temp.setNext(trail);
      head.setNext(temp);
     }
     size++;
    }
    
    d) None of the mentioned
  • filter_dramaExplanation
    Answer is : A
    None.
  • 4. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?
  • filter_dramaExplanation
    Answer is : A
    None.
  • 5. In a priority queue, insertion and deletion takes place at
  • filter_dramaExplanation
    Answer is : D
    None.

Data StructureTopics

leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points