Added sort method in Queue class