I am currently writing an essay and I'd like to insert some kind of code. This is my first time trying such a thing so I'm very unexperienced. I found the packages algorithm, algorithmicx, algpseudocode on the internet and I think I understand what they're doing (found this). Nevertheless, I am not able to compile my document. It always says "algorithm.sty" not found when trying to compile. I think there is some error installing the package? What should I do?
\documentclass[arxiv,reqno,twoside,a4paper,12pt]{amsart}
\usepackage{algorithm, algpseudocode}
\begin{document}
\begin{algorithmic}[1]
\STATE S := I
\WHILE{$\frac{h}{k} \ne \Phi(S)$}
\IF{$\frac{h}{k} < \Phi(S)$} $S = SL$
\ELSE $S = SR$ \ENDIF
\ENDWHILE
\end{algorithm}
\end{document}

install missing packages on the fly– naphaneal Jun 17 '18 at 10:45