next up previous
Next: 4.6 Amortized Algorithm Analysis Up: 4.5 Splay Trees Previous: 4.5 Splay Trees

4.5.1 Search, Insert, Delete in Bottom-up Splaying

Search (i, t)

If item i is in tree t, return a pointer to the node containing i; otherwise return a pointer to the null node.

Example of an unsuccessful search: See Figure 4.23.


  
Figure 4.23: An example of searching in splay trees
\begin{figure}
\centerline{\psfig{figure=figures/Fsplaysearch.ps,width=5in}}
\end{figure}

Insert (i, t)

For an example, See Figure 4.24.


  
Figure 4.24: An example of an insert in a splay tree
\begin{figure}
\centerline{\psfig{figure=figures/Fsplayinsert.ps,width=5in}}
\end{figure}

Delete (i, t)

For an example, see Figure 4.25.


  
Figure 4.25: An example of a delete in a splay tree
\begin{figure}
\centerline{\psfig{figure=figures/Fsplaydelete.ps,width=5in}}
\end{figure}


next up previous
Next: 4.6 Amortized Algorithm Analysis Up: 4.5 Splay Trees Previous: 4.5 Splay Trees
eEL,CSA_Dept,IISc,Bangalore