\hypertarget{classmeow_1_1SplayTree}{\section{meow\-:\-:Splay\-Tree$<$ Key, Value $>$ Class Template Reference}
\label{classmeow_1_1SplayTree}\index{meow\-::\-Splay\-Tree$<$ Key, Value $>$@{meow\-::\-Splay\-Tree$<$ Key, Value $>$}}
}


是一種神乎其技的資料結構, 維護一堆 Key-\/$>$Value . 並且支援 一些 {\ttfamily std\-::map} 難以快速實踐的操作, 如 {\ttfamily split} , {\ttfamily merge} , {\ttfamily key\-Offset}  




{\ttfamily \#include \char`\"{}Splay\-Tree.\-h\char`\"{}}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classmeow_1_1SplayTree_1_1Element}{Element}
\begin{DoxyCompactList}\small\item\em 類似 {\ttfamily stl} 的 {\ttfamily iterator} ,不過這邊叫做{\ttfamily \hyperlink{classmeow_1_1SplayTree_1_1Element}{Element}} \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classmeow_1_1SplayTree_a640cec3815f70c0a7eac811d7272c637}{Splay\-Tree} ()
\begin{DoxyCompactList}\small\item\em constructor \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_addfdea993d700469785b3e01631ec3c0}{Splay\-Tree} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} const \&tree2)
\begin{DoxyCompactList}\small\item\em constructor, 複製資料 \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_a8a3e10edd9aa04a5786ad6d8b7dd5490}{$\sim$\-Splay\-Tree} ()
\begin{DoxyCompactList}\small\item\em destructor \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} \& \hyperlink{classmeow_1_1SplayTree_aafc78f8d6abc95d52ba1062c14946cd5}{copy\-From} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} const \&tree2)
\begin{DoxyCompactList}\small\item\em 複製資料 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1SplayTree_a169eca2b27a5ec844bd79bba2bb75412}{move\-To} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} $\ast$tree2)
\begin{DoxyCompactList}\small\item\em 將資料都丟到 {\ttfamily tree2} 身上, 並且清空自己 \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a48d6f8f0af07a6620bd73a92db226ce6}{lower\-Bound} (Key const \&key) const 
\begin{DoxyCompactList}\small\item\em 找出第一個(最小的) Element且 {\ttfamily k} $<$= 它的 Key, 並且回傳之. \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a9cd532f990a5fe6ff0930fc297cf664e}{upper\-Bound} (Key const \&key) const 
\begin{DoxyCompactList}\small\item\em 找出第一個(最小的) Element且 {\ttfamily k} $<$ 它的 Key, 並且回傳之. \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a06dd77ef9bd62d83a7571feca5324825}{r\-Lower\-Bound} (Key const \&key) const 
\begin{DoxyCompactList}\small\item\em 找出第一個(最小的) Element且 {\ttfamily k} $>$= 它的 Key, 並且回傳之. \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a7e4eb9104cd7a2c01cda7e0a19c55cbe}{r\-Upper\-Bound} (Key const \&key) const 
\begin{DoxyCompactList}\small\item\em 找出第一個(最小的) Element且 {\ttfamily k} $>$ 它的 Key, 並且回傳之. \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a67dc7214cf9a89053e4b719f4d60cb4c}{find} (Key const \&key) const 
\begin{DoxyCompactList}\small\item\em 找出 Key= {\ttfamily k} 的\-Elemenet 並回傳. 找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_ad91ceed4303b4fc5b115b067d304debc}{order} (size\-\_\-t order) const 
\begin{DoxyCompactList}\small\item\em 將\-Elements依照\-Key由小到大排序, 回傳第 {\ttfamily ord} 個\-Element (由0算起). \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_ad8c3814cbfbcc9f754b62a74368ddc0b}{first} () const 
\begin{DoxyCompactList}\small\item\em 回傳\-Key最小的\-Element, 如果\-Splay\-Tree為空, 則回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_a805efe9b5f4bac68fd62908eb7cf3501}{last} () const 
\begin{DoxyCompactList}\small\item\em 回傳\-Key最大的\-Element, 如果\-Splay\-Tree為空, 則回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} \hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end} () const 
\begin{DoxyCompactList}\small\item\em 回傳一個指向\-N\-U\-L\-L的\-Element, \end{DoxyCompactList}\item 
size\-\_\-t \hyperlink{classmeow_1_1SplayTree_a40b663d34933b258e667f9205f469fdc}{size} () const 
\begin{DoxyCompactList}\small\item\em 回傳資料個數 \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1SplayTree_a8dac8bccc08f9c1c828b25b7fe9919c7}{empty} () const 
\begin{DoxyCompactList}\small\item\em 回傳是否為空 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1SplayTree_ae5a57883fd31a6288b958b42b94606a9}{clear} ()
\begin{DoxyCompactList}\small\item\em 清空 \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1SplayTree_a0ae5e48da8d18ad8b2dc839d1c1b5582}{insert} (Key const \&key, Value const \&value)
\begin{DoxyCompactList}\small\item\em 插入一組{\ttfamily }(Key ---$>$ {\ttfamily Value}) \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1SplayTree_aef1f4e901e3e17a67e45aa2b9f9b61db}{erase} (Key const \&key)
\begin{DoxyCompactList}\small\item\em 刪除一組資料 \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1SplayTree_aead0d2eba7528aeff12f6c0f87c60917}{key\-Offset} (Key const \&delta)
\begin{DoxyCompactList}\small\item\em 將所有\-Element的\-Key同加上 {\ttfamily delta} \end{DoxyCompactList}\item 
void \hyperlink{classmeow_1_1SplayTree_a36a55daf9150ae2d866075dedf1d583d}{split\-Out} (Key const \&upper\-\_\-bound, \hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} $\ast$right)
\begin{DoxyCompactList}\small\item\em 將{\ttfamily tree2} 清空, 再將所有\-Key $>$ {\ttfamily upper\-\_\-bound} 的\-Element都丟過去 \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1SplayTree_a17f0fea3a3f4c7a548743bee7e5a285c}{merge\-After} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} $\ast$tree2)
\begin{DoxyCompactList}\small\item\em 合併 \end{DoxyCompactList}\item 
bool \hyperlink{classmeow_1_1SplayTree_a9d370115877428e58b1595458dc345a3}{merge} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} $\ast$tree2)
\begin{DoxyCompactList}\small\item\em 合併 \end{DoxyCompactList}\item 
Value \& \hyperlink{classmeow_1_1SplayTree_a9f02a4ccc46616b7923c5834e02d53bc}{operator\mbox{[}$\,$\mbox{]}} (Key const \&key)
\begin{DoxyCompactList}\small\item\em 就像{\ttfamily stl\-::map\-::operator}\mbox{[}\mbox{]} \end{DoxyCompactList}\item 
\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} \& \hyperlink{classmeow_1_1SplayTree_aef1da0d72d3a88851bd805d489fb6ea0}{operator=} (\hyperlink{classmeow_1_1SplayTree}{Splay\-Tree} const \&tree2)
\begin{DoxyCompactList}\small\item\em same as {\ttfamily copy\-From(tree2)} \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class Key, class Value$>$class meow\-::\-Splay\-Tree$<$ Key, Value $>$}

是一種神乎其技的資料結構, 維護一堆 Key-\/$>$Value . 並且支援 一些 {\ttfamily std\-::map} 難以快速實踐的操作, 如 {\ttfamily split} , {\ttfamily merge} , {\ttfamily key\-Offset} 

\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 Key &\PBS\raggedleft operator+ &(Key {\ttfamily k}) &\PBS\centering Key &相加 \\\cline{1-6}
\PBS\raggedleft const &\PBS\centering Key &\PBS\raggedleft operator$<$ &(Key {\ttfamily k}) &\PBS\centering bool &大小比較 \\\cline{1-6}
\PBS\raggedleft &\PBS\centering Key &\PBS\raggedleft operator= &(Key {\ttfamily k}) &\PBS\centering Key &copy oper \\\cline{1-6}
\PBS\raggedleft &\PBS\centering Key &\PBS\raggedleft Key &(int {\ttfamily n}) &\PBS\centering &構子,{\ttfamily n} 永遠是0 \\\cline{1-6}
\PBS\raggedleft &\PBS\centering Value &\PBS\raggedleft Value &( ) &\PBS\centering &建構子 \\\cline{1-6}
\end{TabularC}


\begin{DoxyNote}{Note}
\-: -\/假設現在有兩個\-Splay\-Tree {\ttfamily A} 和 {\ttfamily B}, 則\-: -\/執行 {\ttfamily B.\-move\-To(\&\-A)} 後 {\ttfamily B} 會變成空的, {\ttfamily A} 原本擁有的資料也會覆蓋掉 -\/行 {\ttfamily A.\-merge(\&\-B)} 或 {\ttfamily A.\-merge\-After(\&\-B)} 後 如果檢查發現確實可以merge, 則之後 {\ttfamily B} 會變成空的
\end{DoxyNote}
\begin{DoxyAuthor}{Author}
cat\-\_\-leopard 
\end{DoxyAuthor}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classmeow_1_1SplayTree_a640cec3815f70c0a7eac811d7272c637}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!Splay\-Tree@{Splay\-Tree}}
\index{Splay\-Tree@{Splay\-Tree}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{Splay\-Tree}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::{\bf Splay\-Tree} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a640cec3815f70c0a7eac811d7272c637}


constructor 

\hypertarget{classmeow_1_1SplayTree_addfdea993d700469785b3e01631ec3c0}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!Splay\-Tree@{Splay\-Tree}}
\index{Splay\-Tree@{Splay\-Tree}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{Splay\-Tree}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::{\bf Splay\-Tree} (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ const \&}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_addfdea993d700469785b3e01631ec3c0}


constructor, 複製資料 

\hypertarget{classmeow_1_1SplayTree_a8a3e10edd9aa04a5786ad6d8b7dd5490}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!$\sim$\-Splay\-Tree@{$\sim$\-Splay\-Tree}}
\index{$\sim$\-Splay\-Tree@{$\sim$\-Splay\-Tree}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{$\sim$\-Splay\-Tree}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::$\sim${\bf Splay\-Tree} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a8a3e10edd9aa04a5786ad6d8b7dd5490}


destructor 



\subsection{Member Function Documentation}
\hypertarget{classmeow_1_1SplayTree_ae5a57883fd31a6288b958b42b94606a9}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!clear@{clear}}
\index{clear@{clear}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{clear}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ void {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::clear (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_ae5a57883fd31a6288b958b42b94606a9}


清空 

\hypertarget{classmeow_1_1SplayTree_aafc78f8d6abc95d52ba1062c14946cd5}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!copy\-From@{copy\-From}}
\index{copy\-From@{copy\-From}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{copy\-From}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Splay\-Tree}\& {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::copy\-From (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ const \&}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_aafc78f8d6abc95d52ba1062c14946cd5}


複製資料 

\hypertarget{classmeow_1_1SplayTree_a8dac8bccc08f9c1c828b25b7fe9919c7}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!empty@{empty}}
\index{empty@{empty}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{empty}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ bool {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::empty (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a8dac8bccc08f9c1c828b25b7fe9919c7}


回傳是否為空 

\hypertarget{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!end@{end}}
\index{end@{end}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{end}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::end (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}


回傳一個指向\-N\-U\-L\-L的\-Element, 

以供 {\ttfamily find} ,{\ttfamily order} ,{\ttfamily first} ,{\ttfamily last} 等判斷是否有找到相對應的\-Element \hypertarget{classmeow_1_1SplayTree_aef1f4e901e3e17a67e45aa2b9f9b61db}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!erase@{erase}}
\index{erase@{erase}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{erase}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ bool {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::erase (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_aef1f4e901e3e17a67e45aa2b9f9b61db}


刪除一組資料 

檢查是否已有\-Element的\-Key 為 {\ttfamily key}, 若有則刪除之, 並回傳 {\ttfamily true}, 否則則回傳 {\ttfamily false} \hypertarget{classmeow_1_1SplayTree_a67dc7214cf9a89053e4b719f4d60cb4c}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!find@{find}}
\index{find@{find}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{find}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::find (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a67dc7214cf9a89053e4b719f4d60cb4c}


找出 Key= {\ttfamily k} 的\-Elemenet 並回傳. 找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} 

\hypertarget{classmeow_1_1SplayTree_ad8c3814cbfbcc9f754b62a74368ddc0b}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!first@{first}}
\index{first@{first}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{first}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::first (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_ad8c3814cbfbcc9f754b62a74368ddc0b}


回傳\-Key最小的\-Element, 如果\-Splay\-Tree為空, 則回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} 

\hypertarget{classmeow_1_1SplayTree_a0ae5e48da8d18ad8b2dc839d1c1b5582}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!insert@{insert}}
\index{insert@{insert}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{insert}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ bool {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::insert (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key, }
\item[{Value const \&}]{value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a0ae5e48da8d18ad8b2dc839d1c1b5582}


插入一組{\ttfamily }(Key ---$>$ {\ttfamily Value}) 

檢查是否已有\-Element的\-Key 為 {\ttfamily key}, 若有則回傳 {\ttfamily false} , 否則將 一個 (Key -\/$>$ Value) = ({\ttfamily key} -\/$>$ {\ttfamily value})的\-Element加入, 並回傳 {\ttfamily true} \hypertarget{classmeow_1_1SplayTree_aead0d2eba7528aeff12f6c0f87c60917}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!key\-Offset@{key\-Offset}}
\index{key\-Offset@{key\-Offset}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{key\-Offset}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ void {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::key\-Offset (
\begin{DoxyParamCaption}
\item[{Key const \&}]{delta}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_aead0d2eba7528aeff12f6c0f87c60917}


將所有\-Element的\-Key同加上 {\ttfamily delta} 

\hypertarget{classmeow_1_1SplayTree_a805efe9b5f4bac68fd62908eb7cf3501}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!last@{last}}
\index{last@{last}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{last}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::last (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a805efe9b5f4bac68fd62908eb7cf3501}


回傳\-Key最大的\-Element, 如果\-Splay\-Tree為空, 則回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} 

\hypertarget{classmeow_1_1SplayTree_a48d6f8f0af07a6620bd73a92db226ce6}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!lower\-Bound@{lower\-Bound}}
\index{lower\-Bound@{lower\-Bound}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{lower\-Bound}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::lower\-Bound (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a48d6f8f0af07a6620bd73a92db226ce6}


找出第一個(最小的) Element且 {\ttfamily k} $<$= 它的 Key, 並且回傳之. 

找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \hypertarget{classmeow_1_1SplayTree_a9d370115877428e58b1595458dc345a3}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!merge@{merge}}
\index{merge@{merge}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ bool {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::merge (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ $\ast$}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a9d370115877428e58b1595458dc345a3}


合併 

檢查是否自己中的 Key 都小於 {\ttfamily tree2} 中的\-Key, 或是完全相反, 是的話把 {\ttfamily tree2`中的} \hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} 都搬到自己這, 同時清空 {\ttfamily tree2} , 否則回傳 {\ttfamily false} \hypertarget{classmeow_1_1SplayTree_a17f0fea3a3f4c7a548743bee7e5a285c}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!merge\-After@{merge\-After}}
\index{merge\-After@{merge\-After}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{merge\-After}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ bool {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::merge\-After (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ $\ast$}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a17f0fea3a3f4c7a548743bee7e5a285c}


合併 

檢查是否自己中的 Key 都小於 {\ttfamily tree2} 中的\-Key, 是的話把 {\ttfamily tree2`} 中的 \hyperlink{classmeow_1_1SplayTree_1_1Element}{Element} 都搬到自己這, 同時清空 {\ttfamily tree2} , 否則回傳 {\ttfamily false} \hypertarget{classmeow_1_1SplayTree_a169eca2b27a5ec844bd79bba2bb75412}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!move\-To@{move\-To}}
\index{move\-To@{move\-To}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{move\-To}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ void {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::move\-To (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ $\ast$}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a169eca2b27a5ec844bd79bba2bb75412}


將資料都丟到 {\ttfamily tree2} 身上, 並且清空自己 

\hypertarget{classmeow_1_1SplayTree_aef1da0d72d3a88851bd805d489fb6ea0}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!operator=@{operator=}}
\index{operator=@{operator=}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{operator=}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Splay\-Tree}\& {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::operator= (
\begin{DoxyParamCaption}
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ const \&}]{tree2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_aef1da0d72d3a88851bd805d489fb6ea0}


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

\hypertarget{classmeow_1_1SplayTree_a9f02a4ccc46616b7923c5834e02d53bc}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!operator\mbox{[}$\,$\mbox{]}@{operator[]}}
\index{operator\mbox{[}$\,$\mbox{]}@{operator[]}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{operator[]}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ Value\& {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::operator\mbox{[}$\,$\mbox{]} (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a9f02a4ccc46616b7923c5834e02d53bc}


就像{\ttfamily stl\-::map\-::operator}\mbox{[}\mbox{]} 

會先檢查是否已有\-Element的\-Key 為 {\ttfamily key}, 若有則回傳相對應的\-Value的\-Reference 否則先執行 {\ttfamily insert}(key,Value()) 再回傳相對應的\-Reference \hypertarget{classmeow_1_1SplayTree_ad91ceed4303b4fc5b115b067d304debc}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!order@{order}}
\index{order@{order}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{order}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::order (
\begin{DoxyParamCaption}
\item[{size\-\_\-t}]{order}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_ad91ceed4303b4fc5b115b067d304debc}


將\-Elements依照\-Key由小到大排序, 回傳第 {\ttfamily ord} 個\-Element (由0算起). 

其中如果 {\ttfamily ord$>$N-\/1}, 則會回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_a805efe9b5f4bac68fd62908eb7cf3501}{last()}} \hypertarget{classmeow_1_1SplayTree_a06dd77ef9bd62d83a7571feca5324825}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!r\-Lower\-Bound@{r\-Lower\-Bound}}
\index{r\-Lower\-Bound@{r\-Lower\-Bound}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{r\-Lower\-Bound}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::r\-Lower\-Bound (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a06dd77ef9bd62d83a7571feca5324825}


找出第一個(最小的) Element且 {\ttfamily k} $>$= 它的 Key, 並且回傳之. 

找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \hypertarget{classmeow_1_1SplayTree_a7e4eb9104cd7a2c01cda7e0a19c55cbe}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!r\-Upper\-Bound@{r\-Upper\-Bound}}
\index{r\-Upper\-Bound@{r\-Upper\-Bound}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{r\-Upper\-Bound}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::r\-Upper\-Bound (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a7e4eb9104cd7a2c01cda7e0a19c55cbe}


找出第一個(最小的) Element且 {\ttfamily k} $>$ 它的 Key, 並且回傳之. 

找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} \hypertarget{classmeow_1_1SplayTree_a40b663d34933b258e667f9205f469fdc}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!size@{size}}
\index{size@{size}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ size\-\_\-t {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::size (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a40b663d34933b258e667f9205f469fdc}


回傳資料個數 

\hypertarget{classmeow_1_1SplayTree_a36a55daf9150ae2d866075dedf1d583d}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!split\-Out@{split\-Out}}
\index{split\-Out@{split\-Out}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{split\-Out}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ void {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::split\-Out (
\begin{DoxyParamCaption}
\item[{Key const \&}]{upper\-\_\-bound, }
\item[{{\bf Splay\-Tree}$<$ Key, Value $>$ $\ast$}]{right}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a36a55daf9150ae2d866075dedf1d583d}


將{\ttfamily tree2} 清空, 再將所有\-Key $>$ {\ttfamily upper\-\_\-bound} 的\-Element都丟過去 

\hypertarget{classmeow_1_1SplayTree_a9cd532f990a5fe6ff0930fc297cf664e}{\index{meow\-::\-Splay\-Tree@{meow\-::\-Splay\-Tree}!upper\-Bound@{upper\-Bound}}
\index{upper\-Bound@{upper\-Bound}!meow::SplayTree@{meow\-::\-Splay\-Tree}}
\subsubsection[{upper\-Bound}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class Key , class Value $>$ {\bf Element} {\bf meow\-::\-Splay\-Tree}$<$ Key, Value $>$\-::upper\-Bound (
\begin{DoxyParamCaption}
\item[{Key const \&}]{key}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classmeow_1_1SplayTree_a9cd532f990a5fe6ff0930fc297cf664e}


找出第一個(最小的) Element且 {\ttfamily k} $<$ 它的 Key, 並且回傳之. 

找不到的話回傳 {\ttfamily this-\/$>$\hyperlink{classmeow_1_1SplayTree_abcdab5caa27fecfd980595681381a4dc}{end()}} 

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