Homechevron_rightEngineeringchevron_rightComputer Sciencechevron_rightData Structurechevron_rightMinimum number of queues required for priority queue implementation?

Minimum number of queues required for priority queue implementation?

  • Q. Minimum number of queues required for priority queue implementation?
  • 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. What are the advantages of priority queues?
  • filter_dramaExplanation
    Answer is : D
    None.
  • 2. What data structure is used for breadth first traversal of a graph?
  • filter_dramaExplanation
    Answer is : A
    None.
  • 3. What is the need for a circular queue?
  • filter_dramaExplanation
    Answer is : A
    None.
  • 4. Which of the following is not the type of queue?
  • filter_dramaExplanation
    Answer is : B
    None.
  • 5. Which of the following best describes the growth of a linear queue at runtime?

     (Q is the original queue, size() returns the number of elements in the queue)

    a)
    
    private void expand()
    {
     int length = size();
     int[] newQ = new int[length<<1];
     for(int i=front; i<=rear; i++)
     {
      newQ[i-front] = Q[i%CAPACITY];
     }
     Q = newQ;
     front = 0;
     rear = size()-1;
    }
    
    b)
    
    private void expand()
    {
     int length = size();
     int[] newQ = new int[length<<1];
     for(int i=front; i<=rear; i++)
     {
      newQ[i-front] = Q[i%CAPACITY];
     }
     Q = newQ;
    }
    
    c)
    
    private void expand()
    {
     int length = size();
     int[] newQ = new int[length<<1];
     for(int i=front; i<=rear; i++)
     {
      newQ[i-front] = Q[i];
     }
     Q = newQ;
     front = 0;
     rear = size()-1;
    }
    
    d)
    
    private void expand()
    {
     int length = size();
     int[] newQ = new int[length*2];
     for(int i=front; i<=rear; i++)
     {
      newQ[i-front] = Q[i%CAPACITY];
     }
     Q = newQ;
    }
  • filter_dramaExplanation
    Answer is : A
    None.

Data StructureTopics

leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points