function to compute hausdorff distance between two structures.