Skip to content

Instantly share code, notes, and snippets.

あるぼう albow-net

Block or report user

Report or block albow-net

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@albow-net
albow-net / Station.java
Last active Sep 23, 2018
jgrapht/Station.java
View Station.java
public class Station {
private final String name;
Station( String name ) {
this.name = name;
}
public String getName() {
return this.name;
}
@albow-net
albow-net / Line.java
Last active Sep 24, 2018
jgrapht/Line.java
View Line.java
public class Line {
private final String name;
private final int time;
Line( String name,int time ) {
this.name = name;
this.time = time;
}
public String getName() {
@albow-net
albow-net / ShortestPath.java
Last active Sep 24, 2018
jgrapht/ShortestPath.java
View ShortestPath.java
import org.jgrapht.Graph;
import org.jgrapht.GraphPath;
import org.jgrapht.graph.WeightedMultigraph;
import org.jgrapht.alg.interfaces.ShortestPathAlgorithm.SingleSourcePaths;
import org.jgrapht.alg.shortestpath.DijkstraShortestPath;
public class ShortestPath {
public static void main( String args[] ) {
// グラフオブジェクトを作成
Graph<Station,Line> graph = new WeightedMultigraph<>(Line.class);
View Line.java
public class Line {
private final String name;
private final int price;
private final int time;
Line( String name, int price, int time ) {
this.name = name;
this.price = price;
this.time = time;
}
@albow-net
albow-net / Person.java
Created Sep 2, 2017
再帰型マージソート
View Person.java
public class Person implements Comparable {
private int id;
private String name;
public Person( int id, String name ) {
this.id = id;
this.name = name;
}
public Person() {
@albow-net
albow-net / sort_test_ptr.cpp
Created Sep 2, 2017
再帰型マージソート(ポインタ配列用)
View sort_test_ptr.cpp
#include <vector>
#include <string>
#include <iostream>
#include <ctime>
class Person {
private:
int id;
std::string name;
@albow-net
albow-net / sort_test.cpp
Last active Aug 22, 2017
再帰型マージソート
View sort_test.cpp
#include <vector>
#include <string>
#include <iostream>
#include <ctime>
class Person {
private:
int id;
std::string name;
@albow-net
albow-net / sort_test.swift
Last active Aug 22, 2017
再帰型マージソート
View sort_test.swift
import Foundation
class Person : Comparable{
let id : Int
let name : String
init( id : Int, name : String ) {
self.id = id;
self.name = name;
}
@albow-net
albow-net / array_test.py
Created Aug 18, 2017
配列の読み書き速度測定用ソースコード
View array_test.py
def test_array( N, num ):
# 長さNの配列を用意し0で初期化
array = N * [0]
# 各要素にnumを代入
for i in range(N):
array[i] = num
# 各要素の和を計算
sum = 0
@albow-net
albow-net / array_test.java
Last active Aug 18, 2017
配列の読み書き速度測定用ソースコード
View array_test.java
import java.util.ArrayList;
import java.util.Collections;
public class test{
private static int test_arraylist( int N, int num ) {
// 長さNの配列を用意し0で初期化
ArrayList<Integer> array = new ArrayList<Integer>( Collections.nCopies(N, 0) );
// 各要素にnumを代入
for ( int i = 0; i < N; i++ ) {
You can’t perform that action at this time.