Alternating Characters

  • + 0 comments

    Besides the fact that string comparison is obviously linear, you would still have to have a fallback to a O(n) algorithm. Since for an input tending to infinity you would need to use it, the whole algorithm would still be O(n).