Almost linear time algorithms for problems of computational genomics