Ignore:
Timestamp:
2025-01-02T14:16:53+01:00 (3 months ago)
Author:
stoecker
Message:

see #23688, patch for local URL calling

Location:
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/Bag.java

    r32725 r36362  
    22package edu.princeton.cs.algs4;
    33
    4 /*************************************************************************
     4/* ************************************************************************
    55 *  Compilation:  javac Bag.java
    66 *  Execution:    java Bag < input.txt
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java

    r32725 r36362  
    103103     * Add the edge e to this digraph.
    104104     */
    105     public void addEdge(DirectedEdge e) {
    106         int v = e.from();
    107         adj[v].add(e);
     105    public void addEdge(DirectedEdge ed) {
     106        int v = ed.from();
     107        adj[v].add(ed);
    108108        E++;
    109109    }
    110110
    111111    /**
    112      * Return the edges leaving vertex v as an Iterable.
    113      * To iterate over the edges leaving vertex v, use foreach notation:
    114      * <tt>for (DirectedEdge e : graph.adj(v))</tt>.
     112     * Return the edges leaving vertex ve as an Iterable.
     113     * To iterate over the edges leaving vertex ve, use foreach notation:
     114     * <tt>for (DirectedEdge e : graph.adj(ve))</tt>.
    115115     */
    116     public Iterable<DirectedEdge> adj(int v) {
    117         return adj[v];
     116    public Iterable<DirectedEdge> adj(int ve) {
     117        return adj[ve];
    118118    }
    119119
     
    125125    public Iterable<DirectedEdge> edges() {
    126126        Bag<DirectedEdge> list = new Bag<>();
    127         for (int v = 0; v < V; v++) {
    128             for (DirectedEdge e : adj(v)) {
    129                 list.add(e);
     127        for (int ve = 0; ve < V; ve++) {
     128            for (DirectedEdge ed : adj(ve)) {
     129                list.add(ed);
    130130            }
    131131        }
     
    134134
    135135    /**
    136      * Return number of edges leaving v.
     136     * Return number of edges leaving ve.
    137137     */
    138     public int outdegree(int v) {
    139         return adj[v].size();
     138    public int outdegree(int ve) {
     139        return adj[ve].size();
    140140    }
    141141
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java

    r32725 r36362  
    22package edu.princeton.cs.algs4;
    33
    4 /*************************************************************************
     4/* ************************************************************************
    55 *  Compilation:  javac IndexMinPQ.java
    66 *  Execution:    java IndexMinPQ
  • applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/Stack.java

    r32725 r36362  
    22package edu.princeton.cs.algs4;
    33
    4 /*************************************************************************
     4/* ************************************************************************
    55 *  Compilation:  javac Stack.java
    66 *  Execution:    java Stack < input.txt
     
    160160
    161161
    162     /**
    163      * A test client.
    164      */
     162    ///**
     163    // * A test client.
     164    // */
    165165    //    public static void main(String[] args) {
    166166    //        Stack<String> s = new Stack<String>();
Note: See TracChangeset for help on using the changeset viewer.