Computing the Genomic Distance in Linear Time