A hacker on a roll may be able to produce–in a period of a few months–something that a small development group (say, 7-8 people) would have a hard time getting together over a year. IBM used to report that certain programmers might be as much as 100 times as productive as other workers, or more. Peter Seebach

Priority queue

Language Java | Level Intermediate | Category Algorithms | August 2, 2015 9:05 pm


Algorithm Problem Description

The priority queue is a data structure with each element has a priority associated with it. The high priority element served before low priority element.

Priority queues provide extra flexibility over sorting mechanism. Write a program to implement the priority queue.

Output

          	        
          	        

Unsorted array before sorting from Array: [12, 34, 56, 23, 45, 78, 46]
Unsorted array before sorting from Heap: 78 45 56 12 23 34 46 
Sorted array after sorting from Priority Queue: 78 56 46 45 34 23 12

          	        
          	        				    


Comments



Please login to add comments.