Recovering algorithm and conversion of cyclic algorithms.
Such as a loop implementation for finding a number in the interpolation tree:
Node FINDSIXNODE (Node root) {
Node Curnode = root;
While (curNode) {
IF (Curnode.getValue () == 6) Return Curnode;
Else IF (curnode.getvalue () <6) Curnode = CURNODE.GETRIGHT ();
Else IF (Curnode.getValue ()> 6) Curnode = CURNODE.GETLEFT ();
}
Return NULL;
}
Recursive implementation:
Node FINDSIXNODE (Node root) {
IF (! root) return null;
Else IF (Root.getValue () == 6) Return root;
Else IF (Root.getValue () <6) Return Findsix (Root.Getright ());
Else IF (Root.getValue ()> 6) Return Findsix (Root.getLeft ());
}
}