I studied the gap algorithm(merging without extra space) but after coding, it looks ok to me but it is not giving a correct answer or maybe an error, please check out my code an