A new comparison operation
Suppose you are performing an operation on a string where you have to find the middle of the string. You can do this by stepping in from both ends until you get to the middle. But there are two types of middle. A string with an odd number of characters has a character in its middle. A string with an even number of characters has no middle character; it has two characters next to each other. Consider these two examples:
String 1: 12
34567
Odd number of characters
String 2: 123
45678
Even number of characters
String 1 has an odd number of characters and 4 is the center. String 2 has an even number of characters, and 4 and 5 are on either side of the middle.
Suppose we are stepping through a string using two pointers, one at each end. As we step in from both sides, one pointer goes up and the other goes down. When we get to the middle, either the pointers are the...