I am trying to split the following algorithm into two different slides. Can anyone help me how can I do this?
\documentclass{beamer}
\usepackage{beamerthemesplit} % new
\usetheme{Warsaw}
\numberwithin{equation}{section}
\usepackage{graphics,graphicx}
\mode<presentation>
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algcompatible}
\begin{document}
{
\subsection{Algorithm}
\frame {\frametitle{Algorithm}
\begin{algorithm}[H]
\caption{Primal Active-Set Method for Convex QP}
\begin{algorithmic}[1]
\State \texttt{Compute a feasible starting point $x_0$;}
\State \texttt{Set $\mathcal{W}_0$ to be a subset of the active constraints at $x_0$;}
%\
%\Set $\mathcal{W}_0$ to be a subset of the active constraints at $x_0$;
\For{\texttt{k = 0, 1, 2, ....}}
\State \texttt{solve to find $p_k$;}
\If{\texttt{$p_k=0$}}
\State \texttt{Compute Lagrange multipliers $\hat{\lambda_i}$that satisfy,}
\State \texttt{ with $\hat{\mathcal{W}}=\mathcal{W}_k$}
\If{\texttt{$\hat{\lambda_i}\geq 0$ for all $i \in \mathcal{W}_k \cap \mathcal{I}$ }}
\State \texttt{stop with the solution $x^*=x_k$;}
\Else
\State \texttt{$j \leftarrow$ arg min$_{j \in \mathcal{W}_k\cap \mathcal{I}} ~\hat{\lambda_j}$ ;}
\State \texttt{$x_{k+1} \leftarrow x_k;$~$\mathcal{W}_{k+1} \leftarrow \mathcal{W}_k/ \{j\}$;}
\EndIf
%\EndIf
\algstore{myalg}
\end{algorithmic}
\end{algorithm}
}
\frame{
\begin{algorithm}
\begin{algorithmic} [1] % enter the algorithmic environment
\algrestore{myalg}
\Else{\texttt{($p_k \neq 0$)}}
\State \texttt{Compute $\alpha_k$ from ;}
\State \texttt{$x_{k+1} \leftarrow x_k + \alpha_k p_k$;}
\If{\texttt{there are blocking constraints}}
\State \texttt{Obtain $\mathcal{W}_{k+1}$ by adding one of the blocking constraints to $\mathcal{W}_k$;}
\Else
\State \texttt{$\mathcal{W}_{k+1} \leftarrow \mathcal{W}_k;$}
\EndIf
\EndIf
\EndFor
\end{algorithmic}
\label{alg_1}
\end{algorithm}
}
\end{document}
\documentclass{...}, the required\usepackage's,\begin{document}, and\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Willoughby Apr 05 '22 at 23:02