Skip to content

Instantly share code, notes, and snippets.

View felixwoestmann's full-sized avatar
🔬

Felix Wöstmann felixwoestmann

🔬
View GitHub Profile
@felixwoestmann
felixwoestmann / SomeMath.java
Created February 7, 2020 16:52
Extended Euclidean Algorithm (with complete output)
public class SomeMath {
public static int extendedEuclideanAlgorithm(int a, int b) {
ArrayList<Integer> g = new ArrayList<>();
g.add(Math.max(a, b));
g.add(Math.min(a, b));
ArrayList<Integer> s = new ArrayList<>();
s.add(0);
ArrayList<Integer> u = new ArrayList<>();
u.add(1);