UNPKG

703 BTypeScriptView Raw
1import { ICompare } from "../interface/ICompare";
2import { BasicBinaryTreeNode } from "../tree/basic-binary-tree/BasicBinaryTreeNode";
3export declare class LeftistTreeNode<T = number> extends BasicBinaryTreeNode<T> {
4 private rank;
5 constructor(value: T, rank: number);
6 Rank: number;
7}
8export declare class LeftistTree<T> {
9 private compare;
10 private root;
11 private count;
12 constructor(compare?: ICompare<T>, value?: T);
13 readonly Root: LeftistTreeNode<T>;
14 readonly Count: number;
15 isEmpty(): boolean;
16 private fixNode;
17 private _merge;
18 merge(tree2: LeftistTree<T>): this;
19 findExtremum(): T;
20 insert(value: T): LeftistTree<T>;
21 deleteExtremum(): T;
22}