\begin{figure}
\begin{center}
\begin{coden}{3.6in}{1in}
{\sc multiUnionHelper}($L$,$Q$)       	             		\\
~~~\cif {\sc isEmpty}($Q$) \cthen				\\
~~~~~~\creturn $L$						\\
~~~$(v,L')$ $\leftarrow$ {\sc deleteMin}($Q$)			\\
~~~($T$, $v$, $L$) $\leftarrow$ \csplitleft($v$, $L$)		\\
~~~\cif $L \neq null$ \cthen 					\\
~~~~~~$Q$ $\leftarrow$ {\sc insert}($Q$,$L$.key,$L$)			\\
~~~$L \leftarrow$ {\sc multiUnionHelper}($L'$, $Q$)		\\
~~~\creturn \cjoinleft($T$, $L$)				\\
								\\
{\sc multiUnion}($Ls$)       	             			\\
~~~$Q$ = new Queue()						\\
~~~{\bf foreach} $L$ {\bf in} $Ls$				\\
~~~~~~$Q$ $\leftarrow$ {\sc insert}($Q$,$L$.key,$L$)			\\
~~~\creturn {\sc multiUnionHelper}(null, $Q$)
\end{coden}
\end{center}
\caption{A simple variant of the multiunion algorithm of Demaine
et al. \cite{Demaine00} using LTreaps.   The {\sc insert}($Q$, $k$, $d$) 
routine places the data $d$ into a priority queue $Q$ based on the key $k$.
We assume that multiple consecutive {\sc deleteMin}s of the same key take
constant time after the first deleteMin.}
\label{fig:multiunioncode} 
\end{figure}
