Java tutorial
//package com.java2s; import java.util.Vector; public class Main { public static double norm(Vector<Double> l1, Vector<Double> l2) { assert (l1.size() == l2.size()); double ans = 0.; for (int i = 0; i < l1.size(); ++i) ans += (l1.elementAt(i) - l2.elementAt(i)) * (l1.elementAt(i) - l2.elementAt(i)); ans = Math.sqrt(ans); return ans; } }