Algorithm Based On Sting Based Partitioning