Function to compute haustorff distance