element.java

来自「用分支界限法解决的几个问题:包括0-1背包问题,最大团问题,电路布线问题,最大装」· Java 代码 · 共 35 行

JAVA
35
字号
/* * Element.java * * Created on 2006年4月17日, 下午2:15 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package test;import java.lang.*;/** * * @author michael */   public   class Element implements Comparable{        int id;        double d;        public Element(int idd,double dd){            id=idd;            d=dd;        }        public int compareTo(Object x){            double xd=((Element)x).d;            if (d<xd) return -1;            if (d==xd) return 0;            return 1;        }        public boolean equals(Object x){            return d==((Element)x).d;        }         }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?