\hypertarget{classmeow_1_1MergeableHeap}{\section{meow\-:\-:Mergeable\-Heap$<$ Element $>$ Class Template Reference}
\label{classmeow_1_1MergeableHeap}\index{meow\-::\-Mergeable\-Heap$<$ Element $>$@{meow\-::\-Mergeable\-Heap$<$ Element $>$}}
}


一個用 {\bfseries 左偏樹} 實作的 {\ttfamily Maximum-\/\-Heap} , 除了原本heap有的功能外, 還支援 {\ttfamily merge} 功能  




{\ttfamily \#include \char`\"{}Mergeable\-Heap.\-h\char`\"{}}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classmeow_1_1MergeableHeap_a7ef8e2deae0058c91eda490005b978f7}{Mergeable\-Heap} ()
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1MergeableHeap_a1d0ef435fb0214b13fbbc1a8b0ce7cdf}{Mergeable\-Heap} (\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} const \&heap2)
\begin{DoxyCompactList}\small\item\em constructor, 並且複製資料 \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1MergeableHeap_a24a0a465dff230206e85f7b3c172553f}{$\sim$\-Mergeable\-Heap} ()
\begin{DoxyCompactList}\small\item\em destructor \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} \& \hyperlink{classmeow_1_1MergeableHeap_a3f9a65eeb600d0b9fba60855b560ab33}{copy\-From} (\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} const \&heap2)
\begin{DoxyCompactList}\small\item\em 複製資料 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1MergeableHeap_acec8dde15d23e729aba90d98417db845}{move\-To} (\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} $\ast$heap2)
\begin{DoxyCompactList}\small\item\em 將自己的資料丟給指定的heap, 從此自己一身空 \end{DoxyCompactList}\item 
Element const \& \hyperlink{classmeow_1_1MergeableHeap_a7daf99f9cc15f0cfa2625da4623b9042}{top} () const 
\begin{DoxyCompactList}\small\item\em 回傳最大的那個 Element \end{DoxyCompactList}\item 
size\-\_\-t \hyperlink{classmeow_1_1MergeableHeap_a112454a9c92b71531429442e95953576}{size} () const 
\begin{DoxyCompactList}\small\item\em 回傳資料個數 \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1MergeableHeap_a531fff6c8a72f09168701a0612b20af7}{empty} () const 
\begin{DoxyCompactList}\small\item\em 回傳是否為空 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1MergeableHeap_a9491f6a76be757ae888a4093c034eedb}{push} (Element const \&value)
\begin{DoxyCompactList}\small\item\em 加入element \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1MergeableHeap_a769478f3424598aa9a408d61b5a83928}{pop} ()
\begin{DoxyCompactList}\small\item\em 將最大的element移除 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1MergeableHeap_aaa072185a884716b2dd5c0ba608be1b0}{clear} ()
\item 
void \hyperlink{classmeow_1_1MergeableHeap_a3638f12db8da212244cb6ab7e37332db}{merge} (\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} $\ast$heap2)
\item 
\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} \& \hyperlink{classmeow_1_1MergeableHeap_a304bacba11be0772b10505b6053a57e1}{operator=} (\hyperlink{classmeow_1_1MergeableHeap}{Mergeable\-Heap} const \&heap2)
\begin{DoxyCompactList}\small\item\em same as {\ttfamily copy\-From(heap2)} \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class Element$>$class meow\-::\-Mergeable\-Heap$<$ Element $>$}

一個用 {\bfseries 左偏樹} 實作的 {\ttfamily Maximum-\/\-Heap} , 除了原本heap有的功能外, 還支援 {\ttfamily merge} 功能 

\subsubsection*{Template Class Operators Request}

\begin{TabularC}{6}
\hline
\rowcolor{lightgray}\PBS\raggedleft {\bf const?}&\PBS\centering {\bf Typename}&\PBS\raggedleft {\bf Operator }&{\bf Parameters }&\PBS\centering {\bf Return Type }&{\bf Description }\\\cline{1-6}
\PBS\raggedleft const &\PBS\centering Element &\PBS\raggedleft operator$<$ &(Element {\ttfamily b})&\PBS\centering bool &大小比較 \\\cline{1-6}
\end{TabularC}


\begin{DoxyNote}{Note}
\-: 假設現在有兩個\-Mergeable\-Heap {\ttfamily A} 和 {\ttfamily B}, 則\-:
\begin{DoxyItemize}
\item 執行 {\ttfamily A.\-merge(\&\-B)} 後 {\ttfamily B} 會變成空的
\item 執行 {\ttfamily B.\-move\-To(\&\-A)} 後 {\ttfamily B} 會變成空的, {\ttfamily A} 原本擁有的資料也會覆蓋掉
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxyAuthor}{Author}
cat\-\_\-leopard 
\end{DoxyAuthor}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classmeow_1_1MergeableHeap_a7ef8e2deae0058c91eda490005b978f7}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!Mergeable\-Heap@{Mergeable\-Heap}}
\index{Mergeable\-Heap@{Mergeable\-Heap}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{Mergeable\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::{\bf Mergeable\-Heap} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a7ef8e2deae0058c91eda490005b978f7}


constructor 

\hypertarget{classmeow_1_1MergeableHeap_a1d0ef435fb0214b13fbbc1a8b0ce7cdf}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!Mergeable\-Heap@{Mergeable\-Heap}}
\index{Mergeable\-Heap@{Mergeable\-Heap}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{Mergeable\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::{\bf Mergeable\-Heap} (
\begin{DoxyParamCaption}
\item[{{\bf Mergeable\-Heap}$<$ Element $>$ const \&}]{heap2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a1d0ef435fb0214b13fbbc1a8b0ce7cdf}


constructor, 並且複製資料 

\hypertarget{classmeow_1_1MergeableHeap_a24a0a465dff230206e85f7b3c172553f}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!$\sim$\-Mergeable\-Heap@{$\sim$\-Mergeable\-Heap}}
\index{$\sim$\-Mergeable\-Heap@{$\sim$\-Mergeable\-Heap}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{$\sim$\-Mergeable\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::$\sim${\bf Mergeable\-Heap} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a24a0a465dff230206e85f7b3c172553f}


destructor 



\subsection{Member Function Documentation}
\hypertarget{classmeow_1_1MergeableHeap_aaa072185a884716b2dd5c0ba608be1b0}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!clear@{clear}}
\index{clear@{clear}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{clear}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ void {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::clear (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_aaa072185a884716b2dd5c0ba608be1b0}
將資料清空 \hypertarget{classmeow_1_1MergeableHeap_a3f9a65eeb600d0b9fba60855b560ab33}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!copy\-From@{copy\-From}}
\index{copy\-From@{copy\-From}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{copy\-From}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ {\bf Mergeable\-Heap}\& {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::copy\-From (
\begin{DoxyParamCaption}
\item[{{\bf Mergeable\-Heap}$<$ Element $>$ const \&}]{heap2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a3f9a65eeb600d0b9fba60855b560ab33}


複製資料 

\hypertarget{classmeow_1_1MergeableHeap_a531fff6c8a72f09168701a0612b20af7}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!empty@{empty}}
\index{empty@{empty}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{empty}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ bool {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::empty (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a531fff6c8a72f09168701a0612b20af7}


回傳是否為空 

\hypertarget{classmeow_1_1MergeableHeap_a3638f12db8da212244cb6ab7e37332db}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!merge@{merge}}
\index{merge@{merge}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ void {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::merge (
\begin{DoxyParamCaption}
\item[{{\bf Mergeable\-Heap}$<$ Element $>$ $\ast$}]{heap2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a3638f12db8da212244cb6ab7e37332db}
將給定的\-Mergeable\-Heap的資料統統加到自己身上並且清空該heap \hypertarget{classmeow_1_1MergeableHeap_acec8dde15d23e729aba90d98417db845}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!move\-To@{move\-To}}
\index{move\-To@{move\-To}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{move\-To}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ void {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::move\-To (
\begin{DoxyParamCaption}
\item[{{\bf Mergeable\-Heap}$<$ Element $>$ $\ast$}]{heap2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_acec8dde15d23e729aba90d98417db845}


將自己的資料丟給指定的heap, 從此自己一身空 

\hypertarget{classmeow_1_1MergeableHeap_a304bacba11be0772b10505b6053a57e1}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!operator=@{operator=}}
\index{operator=@{operator=}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{operator=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ {\bf Mergeable\-Heap}\& {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::operator= (
\begin{DoxyParamCaption}
\item[{{\bf Mergeable\-Heap}$<$ Element $>$ const \&}]{heap2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a304bacba11be0772b10505b6053a57e1}


same as {\ttfamily copy\-From(heap2)} 

\hypertarget{classmeow_1_1MergeableHeap_a769478f3424598aa9a408d61b5a83928}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!pop@{pop}}
\index{pop@{pop}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{pop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ void {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::pop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a769478f3424598aa9a408d61b5a83928}


將最大的element移除 

\hypertarget{classmeow_1_1MergeableHeap_a9491f6a76be757ae888a4093c034eedb}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!push@{push}}
\index{push@{push}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{push}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ void {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::push (
\begin{DoxyParamCaption}
\item[{Element const \&}]{value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a9491f6a76be757ae888a4093c034eedb}


加入element 

\hypertarget{classmeow_1_1MergeableHeap_a112454a9c92b71531429442e95953576}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!size@{size}}
\index{size@{size}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ size\-\_\-t {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::size (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a112454a9c92b71531429442e95953576}


回傳資料個數 

\hypertarget{classmeow_1_1MergeableHeap_a7daf99f9cc15f0cfa2625da4623b9042}{\index{meow\-::\-Mergeable\-Heap@{meow\-::\-Mergeable\-Heap}!top@{top}}
\index{top@{top}!meow::MergeableHeap@{meow\-::\-Mergeable\-Heap}}
\subsubsection[{top}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Element $>$ Element const\& {\bf meow\-::\-Mergeable\-Heap}$<$ Element $>$\-::top (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1MergeableHeap_a7daf99f9cc15f0cfa2625da4623b9042}


回傳最大的那個 Element 



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
meowpp/dsa/\hyperlink{MergeableHeap_8h}{Mergeable\-Heap.\-h}\end{DoxyCompactItemize}
