I have a code for calculating euclidean distance like this :
for(int j=0;j<inputdimension;j++){
distance += Math.pow((vector1[j] - vector2.get(j)), 2);
}
and i've an example of data with different array size that i want to calculate with this euclidean distance function for those two array. for example :
vector1[] = {0.5,0.1,0.3,1.5}
vector2[] = {1.4,3.2,3.4,0.1,7.8,0.2,8.3,8.4}
So far i've encountered example for calculating the euclidean distance with the same array size. So i come up with a solution to remove the remaining array so they go balance like this for example :
vector1[] = {0.5,0.1,0.3,1.5}
vector2[] = {1.4,3.2,3.4,0.1}
The problem is, i dont know if its right or not? is there any other way to balance this data?