Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class Edge implements Comparator<Double>{
  2.         double weight;
  3.         int next;
  4.         Edge(double w, int n){
  5.                 weight = w;
  6.                 next = n;
  7.         }
  8.        
  9.         Edge(){
  10.                
  11.         }
  12.        
  13.         public int compare(Double w1, Double w2){
  14.                 if(w1<w2){
  15.                         return -1;
  16.                 }else if(w1>w2){
  17.                         return 1;
  18.                 }else return 0;
  19.         }
  20.  
  21. }