LaTeX  ‘algorithm’ Package Example

Hey, welcome. Double click anywhere on the text to start writing. In addition to simple text you can also add text formatted in boldface, italic, and yes, math too: \(E=mc^{2}\)! Add images by drag’n’drop or click on the ”Insert Figure” button.

{algorithm}

\label{CHalgorithm}CH election algorithm {algorithmic}[1] \ProcedureCH–Election \Foreach node \(i\) ? \(N\) \StateBroadcast HELLO message to its neighbor \Statelet \(k\) ? \(N1\) (\(i\)) U \(i\) be s.t \StateQOS(\(k\)) = max QOS(\(j\)) |\(j\) ? \(N1\)(\(i\)) U \(i\) \StateMPRSet(\(i\)) = \(k\) \EndFor\EndProcedure