mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2025-01-18 11:14:05 +00:00
fix: Strictly implemented the IBinaryTree interface in TreeMultiMap and AVLTreeMultiMap, while passing the correct MV[] type.
This commit is contained in:
parent
b16559bc54
commit
cbda9c152b
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
import { AVLTreeMultiMapOptions, BTNOptKeyOrNull, BTNRep, OptNodeOrNull } from '../../types';
|
||||
import { AVLTree, AVLTreeNode } from './avl-tree';
|
||||
import { IBinaryTree } from '../../interfaces';
|
||||
|
||||
export class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K, V[]> {
|
||||
/**
|
||||
|
@ -54,14 +55,10 @@ export class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K, V[]> {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
export class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends AVLTree<
|
||||
K,
|
||||
V[],
|
||||
R,
|
||||
MK,
|
||||
MV,
|
||||
MR
|
||||
> {
|
||||
export class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object>
|
||||
extends AVLTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV[], MR>
|
||||
{
|
||||
/**
|
||||
* The constructor initializes an AVLTreeMultiMap with the provided keys, nodes, entries, or raw data
|
||||
* and options.
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
import type { BTNOptKeyOrNull, BTNRep, OptNodeOrNull, TreeMultiMapOptions } from '../../types';
|
||||
import { RedBlackTree, RedBlackTreeNode } from './red-black-tree';
|
||||
import { IBinaryTree } from '../../interfaces';
|
||||
|
||||
export class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<K, V[]> {
|
||||
/**
|
||||
|
@ -60,14 +61,10 @@ export class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<K, V[]>
|
|||
* console.log(tmm.search(new Range(4, 12))); // [5, 10, 12, 7]
|
||||
* console.log(tmm.search(new Range(15, 20))); // [15, 18]
|
||||
*/
|
||||
export class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends RedBlackTree<
|
||||
K,
|
||||
V[],
|
||||
R,
|
||||
MK,
|
||||
MV,
|
||||
MR
|
||||
> {
|
||||
export class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object>
|
||||
extends RedBlackTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV[], MR>
|
||||
{
|
||||
/**
|
||||
* The constructor initializes an TreeMultiMap with the provided keys, nodes, entries, or raw data
|
||||
* and options.
|
||||
|
|
Loading…
Reference in a new issue