• Finds the predecessor of a given element in the splay tree

    The predecessor is the largest element smaller than the given value. This function uses a more comprehensive approach to find predecessors.

    Parameters

    • value: any

      the value to find the predecessor of

    • tree: SplayTree<any>

      the tree to search in

    Returns {
        tree: SplayTree<any>;
        value: any;
    }

    object containing the predecessor value and the splayed tree