If Statement in Laytex - algpseudocode code example

Example: If Statement in Laytex - algpseudocode

\Function{getHomorphism}{XPath $p_3$, XPath $q_3$}
  \ForAll {nodes.getLength}
    \State ($q_3(root)$ == $p_3(root)$) $\leftarrow$ \textbf{true}
    \State \textbf{return} true
    \If{true}
      \ForAll {descendantNodes.getLength}
        \State \textbf{return} true
        \If {true}
          \ForAll {childNodes.getLength}
            \State \textbf{return} true
            \If {true}
              \ForAll {wildcardNodes.getLength}
                \State \textbf{return} true
              \EndFor
            \EndIf
          \EndFor
        \EndIf
      \EndFor
    \Else % \If{true} % <=============================================
      \State \textbf{return} false
    \EndIf
  \EndFor
\EndFunction

Tags:

Misc Example