When I use ShareLatex or MikTex to compile the following LaTeX code:
\begin{algorithm}
\uIf{$|F_d(D'(C_{\hat{i}})) - F_d(D(C_{\hat{i}}))| > \sigma$ OR numSeqNoise > $\mu$}{
SplitCluster($C_j$)\;
}
\uElseIf{$|F_d(D'(C_{\hat{i}})) - F_d(D(C_{\hat{i}}))| > \tau$}{
numSeqNoise++\;
}
\uElseIf{$j \neq \hat{i}$}{
Remove $S_{R}$ from cluster $C_j$\;
Place $S_{R}$ in cluster $C_\hat{i}$\;
}\uElse{
Replace $S_{R}$ in cluster $C_\hat{i}$\;
}
\end{algorithm}
it compiles normally, but when I try to use WriteLatex, then the following error always happens:
Missing { inserted.
<to be read again>
\gdef
l.485 }
\uElse{
The line where the error is pointed out is }\uElse{.
Somebody can help me? ;)


C_{\hat{i}}instead ofC_\hat{i}, because\hatdoesn't open a group. – Henri Menke Sep 10 '14 at 21:33