I try to add some texts used to illustrate the algorithms right below the bottom line of algorithms.
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[hang,flushmargin]{footmisc}
\usepackage{caption}
\begin{document}
\begin{algorithm}
\caption{How to write algorithms}\label{algorithm1}
\KwIn{this text}
\KwOut{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
$y_0\leftarrow y$\;
}
}
\end{algorithm}
\end{document}

I want to add some text below the bottom line as shown below:

Based on How to create footnote for algorithmicx's comment, one should be using a minipage. I update my codes as follows:
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[hang,flushmargin]{footmisc}
\usepackage{caption}
\begin{document}
\noindent\begin{minipage}{\textwidth}
\begin{algorithm}
\caption{How to write algorithms}\label{algorithm1}\footnotetext{$y_0$ denotes the initial value.}
\KwIn{this text}
\KwOut{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
$y_0\leftarrow y$\;
}
}
\end{algorithm}
\renewcommand\footnoterule{}
\end{minipage}
\end{document}
but errors occur.
Any suggestion will be greatly appreciated.

