⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nodeinterface.java

📁 这是一个将Dijkstra算法的时间复杂度从O(n*n) 优化为O(nlogn)的方法
💻 JAVA
字号:
// NodeInterface.java// CNA, S2, 2008// v 0.1, 02 July 2008 - Nick Falknerpublic interface NodeInterface extends Comparable<NetworkNode> {    // You will, of course, also need to add constructors and any other    // methods that you consider useful.    // Need a way to associate links with this node.    // Note: there will be a corresponding way to access links but this    // is left to your discretion.    public void addLink(NetworkLink newLink);    // We represent D(v) as a distance stored in the node.    // Providing we use the same u, this is valid.    public void setDistance(double newDistance);    public double getDistance();    // This keeps track of the node that is immediately previous to us    // on the path back to the source node.    public void setPreviousNode(NetworkNode newPrev);    public NetworkNode getPreviousNode();    // Required by Comparable.    // (A number of handy Java data structures use Comparable)	        public int compareTo(NetworkNode o);}

⌨️ 快捷键说明

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