I am writing a paper in latex and there I am including algorithm. I added every package of an algorithm like
\usepackage{program}\usepackage{algorithm}\usepackage{algpseudocode}\usepackage{algorithmic}\usepackage[options ]{algorithm2e}
I wrote if else with in for loop and that loop is written inside the body of procedure but its wrongly come.
\begin{algorithm}[H]
\caption{Euclid’s algorithm}
\label{alg:euclid}
\begin{algorithmic}[1]
\State $U$: a set of authentic users
\State $T$: a set containing trustor and trustee information
\Procedure{DepthDetection}{$T_{t_h}$, $U_i$}
\State $T_{u_i} \gets$ list of trustee taking $U_i$ as trustor
\State $I_{u_i} \gets$ list of items rated by $U_i$
\State Build $U_i$'s trust network using $T_{t_h}$
\For{each item $i$ in $I_{u_i}$}
\State $NU_{u_i} \gets$ list of users who rated $I_i$
\For{each user $u$ in $NU_{u_i}$ }
\If{$u$ is in $T_{u_i}$}
\State use the rating and trust of $u$ for prediction of rating
\EndIf
\EndFor
\EndFor
\State \textbf{return} $L$
\EndProcedure
\end{algorithmic}
\end{algorithm}

