2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * PURPOSE: Splay-Tree implementation
5 * FILE: lib/rtl/splaytree.c
9 /* INCLUDES *****************************************************************/
16 /* FUNCTIONS ***************************************************************/
24 PRTL_SPLAY_LINKS Links
37 PRTL_SPLAY_LINKS Links
,
38 PRTL_SPLAY_LINKS
*Root
51 PRTL_SPLAY_LINKS Links
64 PRTL_SPLAY_LINKS Links
77 PRTL_SPLAY_LINKS Links
88 PRTL_SPLAY_LINKS NTAPI
89 RtlSubtreePredecessor (IN PRTL_SPLAY_LINKS Links
)
91 PRTL_SPLAY_LINKS Child
;
93 Child
= Links
->RightChild
;
97 if (Child
->LeftChild
== NULL
)
100 /* Get left-most child */
101 while (Child
->LeftChild
!= NULL
)
102 Child
= Child
->LeftChild
;
110 PRTL_SPLAY_LINKS NTAPI
111 RtlSubtreeSuccessor (IN PRTL_SPLAY_LINKS Links
)
113 PRTL_SPLAY_LINKS Child
;
115 Child
= Links
->LeftChild
;
119 if (Child
->RightChild
== NULL
)
122 /* Get right-most child */
123 while (Child
->RightChild
!= NULL
)
124 Child
= Child
->RightChild
;