1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export class Tree<K, V> {
|
7 | root: any;
|
8 | length: number;
|
9 | |
10 |
|
11 |
|
12 | findNext(id: K): V;
|
13 | |
14 |
|
15 |
|
16 | findPrev(id: K): V;
|
17 | |
18 |
|
19 |
|
20 | findNodeWithLowerBound(from: K): any;
|
21 | |
22 |
|
23 |
|
24 | findNodeWithUpperBound(to: K): any;
|
25 | |
26 |
|
27 |
|
28 | findSmallestNode(): V;
|
29 | |
30 |
|
31 |
|
32 |
|
33 | findWithLowerBound(from: K): V;
|
34 | |
35 |
|
36 |
|
37 |
|
38 | findWithUpperBound(to: K): V;
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | iterate(from: K, to: any, f: (arg0: V) => void): void;
|
45 | |
46 |
|
47 |
|
48 |
|
49 | find(id: K): V | null;
|
50 | |
51 |
|
52 |
|
53 |
|
54 | findNode(id: K): N<V> | null;
|
55 | |
56 |
|
57 |
|
58 | delete(id: K): void;
|
59 | _fixDelete(n: any): void;
|
60 | put(v: any): any;
|
61 | _fixInsert(n: any): void;
|
62 | }
|
63 |
|
64 |
|
65 |
|
66 | declare class N<V> {
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 | constructor(val: V);
|
73 | val: V;
|
74 | color: boolean;
|
75 | _left: any;
|
76 | _right: any;
|
77 | _parent: any;
|
78 | isRed(): boolean;
|
79 | isBlack(): boolean;
|
80 | redden(): N<V>;
|
81 | blacken(): N<V>;
|
82 | get grandparent(): any;
|
83 | get parent(): any;
|
84 | get sibling(): any;
|
85 | set left(arg: any);
|
86 | get left(): any;
|
87 | set right(arg: any);
|
88 | get right(): any;
|
89 | rotateLeft(tree: any): void;
|
90 | next(): any;
|
91 | prev(): any;
|
92 | rotateRight(tree: any): void;
|
93 | getUncle(): any;
|
94 | }
|
95 | export {};
|
96 |
|
\ | No newline at end of file |