chenyc
2025-12-09 65e034683b28d799e73c7d7e5e4769fab5b9bc9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export declare const enum TreeNodeColor {
    RED = 1,
    BLACK = 0
}
export declare class TreeNode<K, V> {
    _color: TreeNodeColor;
    _key: K | undefined;
    _value: V | undefined;
    _left: TreeNode<K, V> | undefined;
    _right: TreeNode<K, V> | undefined;
    _parent: TreeNode<K, V> | undefined;
    constructor(key?: K, value?: V);
    /**
     * @description Get the pre node.
     * @returns TreeNode about the pre node.
     */
    _pre(): TreeNode<K, V>;
    /**
     * @description Get the next node.
     * @returns TreeNode about the next node.
     */
    _next(): TreeNode<K, V>;
    /**
     * @description Rotate left.
     * @returns TreeNode about moved to original position after rotation.
     */
    _rotateLeft(): TreeNode<K, V>;
    /**
     * @description Rotate right.
     * @returns TreeNode about moved to original position after rotation.
     */
    _rotateRight(): TreeNode<K, V>;
}
export declare class TreeNodeEnableIndex<K, V> extends TreeNode<K, V> {
    _subTreeSize: number;
    /**
     * @description Rotate left and do recount.
     * @returns TreeNode about moved to original position after rotation.
     */
    _rotateLeft(): TreeNodeEnableIndex<K, V>;
    /**
     * @description Rotate right and do recount.
     * @returns TreeNode about moved to original position after rotation.
     */
    _rotateRight(): TreeNodeEnableIndex<K, V>;
    _recount(): void;
}