Delete Manhattan Distance

This commit is contained in:
keithbored3310 2022-08-30 22:11:35 +08:00 committed by GitHub
parent 9f8b5ddd56
commit a163f805d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,18 +0,0 @@
//This function is calculate the manhattan distance
@param x
@param y
@return {SumOhManhattanDistance}
export default function manhattanDistance(x, y){
let SumOfManhattanDistance = 0;
for (let i = 0; i < x.length; i++){
for (lei j= 0; j < x[i].length ; j++){
//Compute the result of the Manhattan Distance
SumOfManhattanDistance += (Math.abs(x[i] -x[j])+Math.abs(y[i] - y[j]));
}
}
//Send the result back to the main function
return SumOfManhattanDistance;
}