Hey, I wonder which data structure I should use to have faster transferring of letters in string.
For example : I've got two words „GHIJ” and „IGHJ” and my job is changing adjacent letters in first word to make a second word.
So next steps of my program are:
1. start : GHIJ
2. 1st operation : GIHJ
3. 2nd operation : IGHJ
But number of operations can reduce to:
1. start: GHIJ
2. 1st operation: IGHJ
So at the beginning of word I moved 'I', automatically 2 letters after 'I' I moved one position forward.
Does the best solution of problem like this is two-way list or is there any other way to make it faster?