-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
import java.util.*;
public class HelloWorld{
public static void main(String []args){
/*
Comparator<String> temp = new Comparator<String>(){
@Override
public int compare(String s1,String s2){
return s1.length() - s2.length();
}
};
*/
System.out.println("Hello World");
PQS pqs = new PQS();
PriorityQueue<Integer> temp = new PriorityQueue<Integer>(4,pqs);
temp.add(750);
temp.add(500);
temp.add(900);
temp.add(100);
while(!temp.isEmpty()){
System.out.println(temp.poll());
}
}
}
class PQS implements Comparator{
public int compare(Integer one,Integer two){
System.out.println(one + " "+ two);
return two-one;
}
}
Metadata
Metadata
Assignees
Labels
No labels