I got this question on my final exam: Is the following language context-free?
$$ L = \{w\bar w^R \mid w\in \{0,1\}^* \}$$
Notation: The string $\bar w$ is obtained from $w$ by replacing all 0s with 1's and all 1's with 0's. The string $\bar w^R$ is $\bar w$ in reverse order.
I've thought about it being a context-free language, but I notice that when you pump the string in the middle, the string will still be in the language. (using pumping lemma)
I think it's context free. This is the context free grammar:
$$ S \to 0S1 \mid 1S0 \mid \varepsilon $$ (It's basically a palindrome, but both sides are exact opposites.)