import type TreeIterator from './TreeIterator'; import { Container } from "../../ContainerBase"; declare abstract class TreeContainer extends Container { /** * @param cmp The compare function. * @param enableIndex Whether to enable iterator indexing function. */ protected constructor(cmp?: (x: K, y: K) => number, enableIndex?: boolean); /** * @param _key The given _key you want to compare. * @return An iterator to the first element not less than the given _key. */ abstract lowerBound(_key: K): TreeIterator; /** * @param _key The given _key you want to compare. * @return An iterator to the first element greater than the given _key. */ abstract upperBound(_key: K): TreeIterator; /** * @param _key The given _key you want to compare. * @return An iterator to the first element not greater than the given _key. */ abstract reverseLowerBound(_key: K): TreeIterator; /** * @param _key The given _key you want to compare. * @return An iterator to the first element less than the given _key. */ abstract reverseUpperBound(_key: K): TreeIterator; /** * @description Union the other tree to self. * @param other The other tree container you want to merge. */ abstract union(other: TreeContainer): void; clear(): void; /** * @description Update node's _key by iterator. * @param iter The iterator you want to change. * @param _key The _key you want to update. * @return Boolean about if the modification is successful. */ updateKeyByIterator(iter: TreeIterator, _key: K): boolean; eraseElementByPos(pos: number): void; /** * @description Remove the element of the specified _key. * @param _key The _key you want to remove. */ eraseElementByKey(_key: K): void; eraseElementByIterator(iter: TreeIterator): TreeIterator; /** * @description Get the height of the tree. * @return Number about the height of the RB-tree. */ getHeight(): number; } export default TreeContainer;