Need help with Java max heap implementation


  • 0
    X
    
    this fails to pass. what is the difference between this and using Collections.reverseOrder() 
      
    PriorityQueue<Integer> p1 = new PriorityQueue<Integer>(new Comparator<Integer>(){
                    public int compare(Integer i1, Integer i2){
                        return i2-i1;
                    } 
                }    
            );    
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.