Answers for "create a min heap in java using priority queue"

1

create a min heap in java using priority queue

int arr[]={1,2,1,3,3,5,7};
        PriorityQueue<Integer> a=new PriorityQueue<>();
        for(int i:arr){
            a.add(i);
        }
        while(!a.isEmpty())
            System.out.println(a.poll());
Posted by: Guest on September-08-2020

Code answers related to "create a min heap in java using priority queue"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language