I'm trying to figure out the time-complexity of a turing machine that accepts repeat strings (ww) in three cases: a 1-tape deterministic machine, a 2-tape deterministic machine, and 1-tape nondeterministic machine.
Right now my thoughts are that
the 1-tape deterministic machine takes O(n^2) to find the midpoint (by crossing out the first and last symbols in the input repeatedly) and O(n^2) to compare the first and seconds halves (as it has to go back and forth n/2 times, each time going through n/2 of the string),
the 2-tape TM take O(n^2) to find the midpoint, O(n) to copy the second half to the second tape, then O(n) to compare the two halves simultaneously,
and the nondeterministic one guesses the midpoint and take O(n^2) to compare the two halves.
However, I feel like the three cases should not all have the same time complexity of O(n^2) so was wondering if my reasoning is incorrect somewhere (or whether I am correct and just thinking to much about the problem). Any input would be appreciated!