Minimum priority queue using Singly Linked LIst I have written this code for Priority Queue using Singly Linked List. I want to improve this code. Is there any other method to write program for priority queue? 

#include &lt;iostream&gt;

template&lt;typename T&gt;
class priorityQueue
{
  struct Node
  {
    int priority;
    T info;
    Node* next;
    Node(T item) : info(item), next(nullptr) {}
  };
  Node* front;

public:
  priorityQueue() : front(nullptr) {}
  ~priorityQueue()
  {
    Node *tmp = nullptr;
    while (front){
      tmp   = front;
      front = front-&gt;next;
      delete tmp;
    }
  front = nullptr;
  }

  priorityQueue(const priorityQueue&lt;T&gt; &amp; pq)     = delete;
  priorityQueue&amp; operator=(priorityQueue const&amp;) = delete;

  void insert(T item, int priority)
  {
    Node* tmp;
    Node* node     = new Node(item);
    node-&gt;priority = priority;

    if(front == nullptr || priority &lt; front-&gt;priority)
    {
      node-&gt;next = front;
      front = node;
    }
    else
    {
      tmp = front;
      while(tmp-&gt;next != nullptr &amp;&amp; tmp-&gt;next-&gt;priority &lt;= priority)
        tmp = tmp-&gt;next;

      node-&gt;next  = tmp-&gt;next;
      tmp-&gt;next   = node;
    }
  }

  void deleteItem(T item)
  {
    Node* find = search(item);
    Node* node = front;
    if(node == find)
      front = node-&gt;next;
    else
    {
      while(find != nullptr)
      {
        if(node-&gt;next == find)
        {
          node-&gt;next = find-&gt;next;
          delete find;
          return;
        }
        node = node-&gt;next;
      }
    }
  }

  friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp; os, const priorityQueue&lt;T&gt; &amp; pq)
  {
      pq.display(os);
      return os;
  }

private:
  Node *search(T item)
  {
    Node *node = front;
    while(node != nullptr)
    {
    if(node-&gt;info == item)
      return node;
    node = node-&gt;next;
    }
    std::cerr &lt;&lt; "No such element in the list \n";
    return nullptr;
   }

   void display(std::ostream&amp; out = std::cout) const
   {
     Node *node = front;
     out &lt;&lt; "\nItem \tPriority \n";
     while(node != nullptr)
     {
       out &lt;&lt; node-&gt;info &lt;&lt; "\t" &lt;&lt; node-&gt;priority &lt;&lt;"\n";
       node = node-&gt;next;
     }
    }
};

int main()
{
  priorityQueue&lt;std::string&gt; pq1;
  pq1.insert("code", 1);
  pq1.insert("sleep", 3);
  pq1.insert("food", 2);
  pq1.insert("date", 4);
  std::cout &lt;&lt; pq1;
}
Data structures

Although the name "priority queue" is technically correct,
I find it a bit misleading,
because priority queues are usually implemented using a heap data structure,
with insert and find operations in \$O(\log n)\$ time.
Your implementation is practically a sorted linked list,
with insert and find operations in \$O(n)\$ time.
I'd clarify as "naive priority queue" to avoid confusion.

Memory leak

Watch out for memory leaks.
When deleting the first item,
the deleteItem function simply advances the pointer of front,
without actually deleting the item,
leaving allocated memory behind.

Performance

deleteItem is inefficient,
because it iterates to the node to delete twice:
once to find the node to delete,
and then one more time to actually delete it.